PDA

View Full Version : Locking form fields with an onclick event



mattster1010
06-19-2008, 02:49 AM
Good Morning,

Can anyone tell me how it is possible to lock a field on a form with an onclick event from a command button, can it be done?

I have a field called "hours", once data has been entered into this field I want the user to click the command button to lock the field so no further data entry can take place. It would also be useful to know how to unlock the field with a an onclick event too, with a different command button.

Any help would be much appriecated..

Cheers,

Mattster

Carl A
06-19-2008, 06:26 AM
Private Sub Lockit_Click ()
hours.Locked = True
End Sub

Private Sub Unlockit_Click ()
hours.Locked = False
End If

HTH