filling a form with an array

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top