I have got this code from a previous posting, but am unsure where to place it on my form?
Ian
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
Ian
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