i get an error when i try to run this code can you help Private Sub Form_Current() 'Locked the fields with a For Loop Dim Ctl As Control For Each Ctl.ControlType In Me If Ctl.ControlType = acTextBox Or Ctl.ControlType = acComboBox Then Ctl.Locked = True Ctl.BackColor = RGB(220, 220, 220) 'smokeyn grey
Ah. Yep. You got that one past me too. It's sometimes difficult to debug code without actually running it yourself. I just glanced at it and missed that. You're right it should be:
For Each Ctl in Me
Good catch.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.