How do I show a Message Box dependant on conditions in previous Re

K

Kiwi Bill

Dataentry form includes fields MemberID, Verbal Warning, Written Warning.
When an entry into Verbal Warning (yes/no) field is attempted then a Message
Box should pop up containing the words "Verbal Warning previously Issued.
This Warning should be Written" This is IF a previous record exists for this
MemberID with the Verbal Warning box checked. If no such record exists the
Message box should not appear.
 
K

Klatuu

Use the Before Update event of the Verbal Warning check box:

If me.chkVerbalWarning = True Then
If Nz(DLookup("[VerbalWarning]", "MyTableName", "[MemberID] = " _
& Me.txtMemberId), 0) = True Then
MsgBox "This Jerk is a ScrewUp, Slap the Crap Out of Him"
Cancel = True
End If
End If
 
K

Kiwi Bill

Wonderful Klatuu,
It works like a charm and now I better understand the Before Update Event.
Thank you so much for that and for your prompt response

Klatuu said:
Use the Before Update event of the Verbal Warning check box:

If me.chkVerbalWarning = True Then
If Nz(DLookup("[VerbalWarning]", "MyTableName", "[MemberID] = " _
& Me.txtMemberId), 0) = True Then
MsgBox "This Jerk is a ScrewUp, Slap the Crap Out of Him"
Cancel = True
End If
End If


Kiwi Bill said:
Dataentry form includes fields MemberID, Verbal Warning, Written Warning.
When an entry into Verbal Warning (yes/no) field is attempted then a Message
Box should pop up containing the words "Verbal Warning previously Issued.
This Warning should be Written" This is IF a previous record exists for this
MemberID with the Verbal Warning box checked. If no such record exists the
Message box should not appear.
 
Top