I am new to access and i am trying to build a database for enntering Subscription details of a particular journal. Wat I want is that FirstName field on the form should not be left blank. If the user does not enters the First Name and moves to the field, there should be msgbox prompt, prompting the user that the name cannot be left blank and the cursor should be back on the Firstname text box.
I have tried using the foll code:
[CODE=vb]Private Sub FirstName_LostF ocus()
If IsNull(Me.First Name) Then
MsgBox "First Name cannot be left blank"
Me.FirstName.Se tFocus
'Exit Sub
End If
End Sub
[/CODE]
But the problem is that the cursor does not comes back to FirstName text box. Can anyone help me on this....
Sajit
I have tried using the foll code:
[CODE=vb]Private Sub FirstName_LostF ocus()
If IsNull(Me.First Name) Then
MsgBox "First Name cannot be left blank"
Me.FirstName.Se tFocus
'Exit Sub
End If
End Sub
[/CODE]
But the problem is that the cursor does not comes back to FirstName text box. Can anyone help me on this....
Sajit
Comment