Here is some code that I've used from another person on the forum.
THIS is expecially useful if there is more than ONE field on the form that needs to be REQUIRED.
----
'from KNX code of forum
'ERROR HANDLING
'Loops through all fields that have tag set as "validate"
'checks if they are null and stops user if they are
'highlights in yellow those fields null and then stops event
Dim currctl As Integer, numctls As Integer
Dim ctl As Control
numctls = Forms!frmMaterials.Count 'counts the number of controls on form
For currctl = 0 To numctls - 1
Set ctl = Me(currctl)
' do we want to check this control?
If ctl.Tag = "validate" Then
If IsNull(ctl) Then
MsgBox "You have not filled in information that is required by this database. Please fill in the fields highlighted in YELLOW.", 48, "Field empty"
ctl.BackColor = 65535
ctl.SetFocus
Exit Sub
End If
End If
Next currctl
'If all information required is filled out goto a new record
DoCmd.GoToRecord , , acNewRec
Me.Title.SetFocus