2 simple questions

octatyan

Registered User.
Local time
Today, 01:31
Joined
Jan 10, 2003
Messages
36
a simple question

When users enter a new record and click the SAVE button, I want access to only save if lastname has been entered. What is the code to check is the lastname field has any info in it?

*** i solved my 2nd question, so I only have 1 question now.
 
Last edited:
You need some code in your form's Before Update event that checks the status of the Lastname field, something like:

If IsNull(Trim(Me.txtLastName)) Then
  MsgBox "Lastname field not filled in"
  Cancel=True
  Me.txtLastName.SetFocus
Else
  DoCmd.RunCommand acCmdSaveRecord
End If
 

Users who are viewing this thread

Back
Top Bottom