Please can someone help with what i thought would be a simple problem but has turned out to be very annoying.
I have a form bound to a table with about ten textboxes with the first one (accountcode) as the primary key in the table being required. I have tried the following code in the before and afterupdate events of the textbox with no luck
If Me.Accountcode = "" Or IsNull(Me.Accountcode) Then
MsgBox "A valid accountcode must be entered before continuing", vbOKOnly
Cancel = True
Me.Undo
End If
I want the message box to pop up if the user presses the enter or tab key before entering data into the textbox.
At the moment it just moves to the next field on the form and then gives me the primary key cannot contain a null value at the end of the form which i would like to stop.
Thanks in advance
Gareth
I have a form bound to a table with about ten textboxes with the first one (accountcode) as the primary key in the table being required. I have tried the following code in the before and afterupdate events of the textbox with no luck
If Me.Accountcode = "" Or IsNull(Me.Accountcode) Then
MsgBox "A valid accountcode must be entered before continuing", vbOKOnly
Cancel = True
Me.Undo
End If
I want the message box to pop up if the user presses the enter or tab key before entering data into the textbox.
At the moment it just moves to the next field on the form and then gives me the primary key cannot contain a null value at the end of the form which i would like to stop.
Thanks in advance
Gareth