Disable text box if other text box value is null

hrdpgajjar

Registered User.
Local time
Tomorrow, 00:48
Joined
Sep 24, 2019
Messages
137
Hi all,
I've created a form for data entry. I've to do the following,

If a Regi_No text box value is null then,

automatically disable all other textboxes in form.

I've implemented the code under after update as under,

If IsNull(Me.Regi_No) Then
Me.Village.Enabled = False

Else
Me.Village.Enabled = True
End If

everything works fine. But I've to enter any value at-least once to work the code. It is not working in case of tab press.

I've to close and open the form everytime to do the code work.

help appreciated ....
 
Could use Conditional Formatting instead of VBA.
 
also call the AfterUpdate event in the Form's Current event:
Code:
Private Sub Form_Current()
    Call Regi_No_AfterUpdate
End Sub
 
also call the AfterUpdate event in the Form's Current event:
Code:
Private Sub Form_Current()
    Call Regi_No_AfterUpdate
End Sub


Thanks, My work done with me.disable=false code at the form load event...

Cheers!!!
 

Users who are viewing this thread

Back
Top Bottom