By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

disabling all fields on a form

P: 1
hi,

i have a form with a lot of fields on it. I would like to enable/disable all these fields using a checkbox. Is there a way to do this (perhaps using a loop mayb), without having to name each field and disable it - which would result in too many lines of code?

Any help would be appreciated!
thanks!
Aug 11 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
You could always set the Form to disallow Edits

Private Sub Form_Load()

If <some condition> Then ' (example checkbox = -1)
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If

End Sub

I would recommend that you also look at setting the AllowAdditions and AllowDeletions to false.
Aug 12 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.