S
Strow
I am new to this so I will try to explain this as best as I can. I have
a form and i want to have the values for fname,lname, and phone locked
so that you must enter a value. im having a little trouble as I am a
little rusty in access. i know you can go into the table to set the
properties to required, but I dont want to have it that way.I want it
to have the message saying "you must have whatever" and not let me
leave that area. any help would be greatly appreciated this is what i
have, but you can still tab to other fields on the report and other
reecords as well. i dont want to tab outside the box or no another
record. Seems like the main problem is she wont set her focus to the
required fields. please help me if you can.
Private Sub FirstName_LostFocus()
On Error GoTo ErrorHandler
If IsNull(FirstName) = True Then
MsgBox "You Must Enter A First Name"
End If
ErrorHandler:
FirstName.SetFocus
End Sub
Private Sub LastName_LostFocus()
If IsNull(LastName) = True Then
LastName.SetFocus
MsgBox "You Must Enter A Last Name"
End If
End Sub
Private Sub Telephone_LostFocus()
If IsNull(Telephone) = True Then
Telephone.SetFocus
MsgBox "You Must Enter A Telephone Number"
End If
End Sub
a form and i want to have the values for fname,lname, and phone locked
so that you must enter a value. im having a little trouble as I am a
little rusty in access. i know you can go into the table to set the
properties to required, but I dont want to have it that way.I want it
to have the message saying "you must have whatever" and not let me
leave that area. any help would be greatly appreciated this is what i
have, but you can still tab to other fields on the report and other
reecords as well. i dont want to tab outside the box or no another
record. Seems like the main problem is she wont set her focus to the
required fields. please help me if you can.
Private Sub FirstName_LostFocus()
On Error GoTo ErrorHandler
If IsNull(FirstName) = True Then
MsgBox "You Must Enter A First Name"
End If
ErrorHandler:
FirstName.SetFocus
End Sub
Private Sub LastName_LostFocus()
If IsNull(LastName) = True Then
LastName.SetFocus
MsgBox "You Must Enter A Last Name"
End If
End Sub
Private Sub Telephone_LostFocus()
If IsNull(Telephone) = True Then
Telephone.SetFocus
MsgBox "You Must Enter A Telephone Number"
End If
End Sub