Full Version: To lock a access form field on loading of form
UtterAccess Forums > Microsoft® Access > Access Forms
gamaz
Hi,
I have bunch of field in a form. However, couple of fields need to be locked if there is a field value.
I have the following code to lock one of the form field. I am putting this code in the form load event.
If Not IsNull(Me.QuoteStatus) Then
Me.QuoteStatus.Locked = True
Else
Me.QuoteStatus.Locked = False
End If
However with the above code I am seeing the field is not locked on form load. Where else do I need to put this code in order to make sure that the code works. Any help is appreciated. Thanks
Larry Larsen
Hi
Also try the forms "Current" event..
thumbup.gif
gamaz
Thanks for your help Larry. I appreciate it. I am going to work on your advise. Regards
HiTechCoach
You really only need the code in the form's On Current event. This event firext every time there is a record change, including when the for first opens. The On Load event only "fires" once.
gamaz
Thanks for your advise. I will try it.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.