Hi, I am tring to consolidate some code in a program I am writing, and I'm hoping what I want to do is possible...
I have sets of objects (text and comboboxes in a frame) and each object in the sets have the same name, but for the last number. For example:
Condition1: (a frame)
Con1.text (a combobox)
eq1.txt (a combobox)
Condition2: (a frame)
Con2.text (a combobox)
eq2.txt (a combobox)
Condition1: (a frame)
Con1.text (a combobox)
eq1.txt (a combobox)
Condition3: (a frame)
Con3.text (a combobox)
eq3.txt (a combobox)
In frame, the only difference between each name is the number at the end. What I want to do is be able to make a single sub that will work for each on them, by changing a variable. Below is how it would work (I know the coding I have here is wrong, but this is the idea.) I'm hoping someone will bae able to tell me how I can actually make this work.
Function Check(X as integer) as string
check = Con(X).text + eq(X).text
End function
Do you see what I am attempting here? I want to be able to call any of my text or comboboxes by changing only 1 variable, the X. Is this possible?
Thanks!
Fion
I have sets of objects (text and comboboxes in a frame) and each object in the sets have the same name, but for the last number. For example:
Condition1: (a frame)
Con1.text (a combobox)
eq1.txt (a combobox)
Condition2: (a frame)
Con2.text (a combobox)
eq2.txt (a combobox)
Condition1: (a frame)
Con1.text (a combobox)
eq1.txt (a combobox)
Condition3: (a frame)
Con3.text (a combobox)
eq3.txt (a combobox)
In frame, the only difference between each name is the number at the end. What I want to do is be able to make a single sub that will work for each on them, by changing a variable. Below is how it would work (I know the coding I have here is wrong, but this is the idea.) I'm hoping someone will bae able to tell me how I can actually make this work.
Function Check(X as integer) as string
check = Con(X).text + eq(X).text
End function
Do you see what I am attempting here? I want to be able to call any of my text or comboboxes by changing only 1 variable, the X. Is this possible?
Thanks!
Fion