Save button (1 Viewer)

COMP

Registered User.
Local time
Yesterday, 21:24
Joined
Jul 20, 2009
Messages
61
hi, i am trying to program the save button where On_click if a certain field is left blank then for a message to appear for them to not progress forward until the field is complete.

any ideas??
 

DCrake

Remembered
Local time
Today, 05:24
Joined
Jun 8, 2005
Messages
8,632
If IsNull(Me.Field) Then
MsgBox
End If
 

COMP

Registered User.
Local time
Yesterday, 21:24
Joined
Jul 20, 2009
Messages
61
Hi there thanks for that. However i am having problems with checking more than one field using the add new button on_click:

If IsNull(Me.Actual_Claim_Date) Then
MsgBox ("Please enter in claim date")
End If
If IsNull(Me.Actual_Claim_Status) Then
MsgBox ("Please enter in claim status")
End If
If IsNull(Me.Quarter_Period) Then
MsgBox ("Please enter in quater period")
End If
DoCmd.GoToRecord , , acNewRec

with this when you press the add new button the message "enter in new claim date" comes up first. Any ideas??

thanks
 

DCrake

Remembered
Local time
Today, 05:24
Joined
Jun 8, 2005
Messages
8,632
The reason why it is coming up first is either this field is null and it it the first condition that is tested. What you can do is use the ElseIf syntax

If IsNull(Field1) Then
Do This
ElseIf IsNull(Field2) Then
Do This
ElseIf IsNull(Field3) Then
Do This
Else
Save Record
End If

This will process each If statement until one of them is true, once encountered it will bypass the remaining If conditions.

David
 

Users who are viewing this thread

Top Bottom