Updating Table on Click - HELP

Grundy82

Registered User.
Local time
Today, 15:37
Joined
Jul 1, 2010
Messages
13
OK, I’m new here and relatively new to access………

I have a form containing a sub form. The sub form is a data entry form which contains 6 fields. I have created a command button to add the fields to the table on click. So far this works ok, however here’s where my problem begins. I want an error message on click if one of the fields has not been completed/left blank.

So far I have this code which I’ve been testing on just one of the fields:

Private Sub Add_new_record_Click()

If Not IsNull("agent - input") = True Then
MsgBox "Missing Data", vbOKOnly
Else
MsgBox "New Record has been added", vbOKOnly
DoCmd.Close
End If

End Sub

I keep getting the first message even when the field is not blank.

Please help!

Cheers
Paul
 
Your reference to the field is incorrect.

Code:
If IsNull(Me.FieldName) Then
   Null
Else
  Not Null
End If
 
Thanks David, worked a treat!

Much appreciated
Paul

 

Users who are viewing this thread

Back
Top Bottom