making check boxes into an array

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
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top