T
Tom Hanley
I am creating a form that offers several check boxes. The use can choose any
combination of check boxes. I then want to populate a field on the form with
the results. Sounds simple and I'm sure it is. I am trying to make it in an
effecient manner. I could hard code the choices and build a string but I
wanted to loop thru the check boxes, test for if checked, grab the
corresponding label and add that to the variable string. I have numbered the
check boxes and labels with corresponding numbers 1-21. My main problem is
that when I build a string in the loop to test the field on the form, it
doesn't recognize the name as a field.
for example:
Do While counter <= 21
wkreq = "check" + Str(counter)
wkdesc = "label" + Str(counter) + ".Caption"
If Me!wkreq <> nil Then <---this is where it fails now
X = X + ", " + wkdesc
End If
counter = counter + 1
Loop
Me!Work_req_desc = X
What is the best way to gather the options/check box/list/combobox info?
Should I be using an array?
combination of check boxes. I then want to populate a field on the form with
the results. Sounds simple and I'm sure it is. I am trying to make it in an
effecient manner. I could hard code the choices and build a string but I
wanted to loop thru the check boxes, test for if checked, grab the
corresponding label and add that to the variable string. I have numbered the
check boxes and labels with corresponding numbers 1-21. My main problem is
that when I build a string in the loop to test the field on the form, it
doesn't recognize the name as a field.
for example:
Do While counter <= 21
wkreq = "check" + Str(counter)
wkdesc = "label" + Str(counter) + ".Caption"
If Me!wkreq <> nil Then <---this is where it fails now
X = X + ", " + wkdesc
End If
counter = counter + 1
Loop
Me!Work_req_desc = X
What is the best way to gather the options/check box/list/combobox info?
Should I be using an array?