How would I put these two BeforeUpdates together

hardhitter06

Registered User.
Local time
Today, 00:56
Joined
Dec 21, 2006
Messages
600
Hello,

How would I put these two BeforeUpdates together?

Code:
Private Sub LastMissingDate_BeforeUpdate(Cancel As Integer)
If LastMissingDate.Value > Date Then
MsgBox ("Last Missing Date cannot be greater than Today's Date!")
Cancel = True
End If
End Sub

Code:
Private Sub LastMissingDate_BeforeUpdate(Cancel As Integer)
If LastMissingDate.Value < FirstMissingDate.Value Then
MsgBox ("Last Missing Date cannot be less than First Missing Date!")
Cancel = True
End If
End Sub

Thank you,
 
How about:

Private Sub LastMissingDate_BeforeUpdate(Cancel As Integer)
If LastMissingDate.Value > Date Then
MsgBox ("Last Missing Date cannot be greater than Today's Date!")
Cancel = True
Exit Sub
End If

If LastMissingDate.Value < FirstMissingDate.Value Then
MsgBox ("Last Missing Date cannot be less than First Missing Date!")
Cancel = True
End If
End Sub
 
Perfect. Thanks Paul
 
No problemo.
 

Users who are viewing this thread

Back
Top Bottom