Access Skip address field if previous field is blank

Joined
Nov 3, 2017
Messages
2
Reaction score
0
I have an access 2007 database that has fields for several addresses. I would like to have access skip subsequent address fields if the previous field is blank. I have done this before but for the life of me cannot remember how it was done. Thanks.
 
I have an access 2007 database that has fields for several addresses. I would like to have access skip subsequent address fields if the previous field is blank. I have done this before but for the life of me cannot remember how it was done. Thanks.


You could try a code such as the following:

Private Sub Form_Load()
Me.txtField2.Enabled = False
Me.txtField3.Enabled = False
End Sub

Private Sub Form_AfterInsert()
Me.txtField2.Enabled = False
Me.txtField3.Enabled = False
End Sub

Private Sub txtField1_AfterUpdate()
If Me.txtField1.Value = "" Then
Me.txtField2.Enabled = False
Me.txtField3.Enabled = False

Else
Me.txtField2.Enabled = True
Me.txtField3.Enabled = True

End If

End Sub
 
Back
Top