Building a String based on Selected Check boxes
For Each ctl In Me.Controls
If TypeName(ctl) = "CheckBox") Then
sTeams = sTeams & "," & ctl.caption
End If
Next ctl
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Neily" wrote in message
...
Hi,
I'm hoping someone can help here coz I'm pretty sure this is possible by
I'm
at a dead end.
I have a UserForm which dynamically creates a set of Check boxes based on
the number of teams in a department. The user should then select what
teams
they wish to use and then once they push an OK button, the Code should
build
a string putting these teams into appostophies(?sp?) separated by commas
eg. 'team1','team2','team3'
Where I got to was I got the form to create the check boxes and set their
NAME property to the team name, then I thought I might be able to loop
through the checkboxes, if they are checked, add that team into the
string,
but I can't dynamically reference the checkboxes.
Anyway, if anyone can offer advise, I'd be very appreciative.
Ta.
Neily
|