enable groups of fields

samonwalkabout

Registered User.
Local time
Today, 22:54
Joined
Mar 14, 2003
Messages
185
Is it possible to group a set of field and name this group so i can call enable from VB.

ie
at the moment

if testing = "yes" then
me.field1.enabled =True
me.field2.enabled =True
ect ect ect for 50 odd fields

If i could name groups

if testing = "yes" then
me.group1.enabled =True

less code horay!
I can see how to group but cant seem to name them so they can be called in VB.

Thanks
 
???

I dont know if its because its monday morning or just the as always wonderful wording of MS help files. but i cant seem to get this to work.. i can tag a multi selection of fields but this tag name doesnt appear in VB window? Have i got the wrong end of the stick here or what???
 
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "A" Then
If Me.Pd = True Then
ctl.Locked = True
ctl.Enabled = False
Else
ctl.Enabled = True
ctl.Locked = False
End If
End If


Next
 
Thanks Rich

Thanks Rich thats done it saved me a lot of pointless code too!!
 

Users who are viewing this thread

Back
Top Bottom