filling a form with an array

G

Guest

I have a form that has 10 checkboxes and want to write the captions based on
an array I have previously filled. The array will change, 1 time it will
have 5 items and the next time it might have 7 or 8 and I plan on disabling
any checkbox that won't have a caption.

I'm having trouble getting started with the code. Any help would be
appreciated.
 
T

Tom Ogilvy

a lot would depend on the particulars.


for i = 1 to 10
if arr(i) <> "" then
with userform1.controls("checkBox" & i")
.Enabled = True
.Label = arr(i)
end With
else
userform1.controls("checkBox" & i).Enabled = False
end if
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