K
knowshowrosegrows
Can someone tell me why the following code does not generate a message box
when Agency_ID is 999 or 888 and the EventDescription field is empty?
Agency_ID is a number field and EventDescription is a memo field.
Private Sub cmdNewRecord_Click()
On Error GoTo Err_cmdNewRecord_Click
If ([Agency_ID] = "999" And [EventDescription] = "") _
Or ([Agency_ID] = "888" And [EventDescription] = "") Then
MsgBox "When choosing "Other, Agency - Describe" or "Other, Sober
House - Describe", you must fill out the Description field.", vbOKOnly
End If
If Me.Dirty Then Me.Dirty = False
If Not Me.NewRecord Then RunCommand acCmdRecordsGoToNew
Exit_cmdNewRecord_Click:
Exit Sub
Err_cmdNewRecord_Click:
MsgBox Err.Description
Resume Exit_cmdNewRecord_Click
End Sub
when Agency_ID is 999 or 888 and the EventDescription field is empty?
Agency_ID is a number field and EventDescription is a memo field.
Private Sub cmdNewRecord_Click()
On Error GoTo Err_cmdNewRecord_Click
If ([Agency_ID] = "999" And [EventDescription] = "") _
Or ([Agency_ID] = "888" And [EventDescription] = "") Then
MsgBox "When choosing "Other, Agency - Describe" or "Other, Sober
House - Describe", you must fill out the Description field.", vbOKOnly
End If
If Me.Dirty Then Me.Dirty = False
If Not Me.NewRecord Then RunCommand acCmdRecordsGoToNew
Exit_cmdNewRecord_Click:
Exit Sub
Err_cmdNewRecord_Click:
MsgBox Err.Description
Resume Exit_cmdNewRecord_Click
End Sub