making check boxes into an array

  • Thread starter Thread starter tina
  • Start date Start date
T

tina

Hi
I have a number of check boxes in a sub form and would like to write code to
fill fields in main form
i will have 10 check boxes where upto 4 will be true value for each record
in main form
if eg 2 check boxes are true value will need to fill first to field of
another array with text associated with each check box
want to do something like
for x = 1 to 10
if box(x) = true then
box(y) = box(x).text
y = y+1
end if
next
where x = checkboxes
and y = fileds to populate i main form
each check box will have different textbox associated
I do not know how to associate each text box with its checkbox and make all
array for loop
hope this makes sense
thank you
tina
 
Use a string variable to refer to the controls like this:

Dim strCtl as string
for x = 1 to 10
strCtl ="box" & i
debug.Print Me(strCtl).Name
next
 
Back
Top