Disable text box if other text box value is null (1 Viewer)

hrdpgajjar

Registered User.
Local time
Today, 23:14
Joined
Sep 24, 2019
Messages
53
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 ....
 

June7

AWF VIP
Local time
Today, 09:44
Joined
Mar 9, 2014
Messages
5,496
Could use Conditional Formatting instead of VBA.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:44
Joined
May 7, 2009
Messages
19,246
also call the AfterUpdate event in the Form's Current event:
Code:
Private Sub Form_Current()
    Call Regi_No_AfterUpdate
End Sub
 

hrdpgajjar

Registered User.
Local time
Today, 23:14
Joined
Sep 24, 2019
Messages
53
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

Top Bottom