Sohaila Taravati
10-29-2001, 10:13 AM
I am trying to clear the field when I click my cancel button, but it's not doing it. What am I doing wrong? Here is my code:
Private Sub BL_BeforeUpdate(Cance As Integer)
If (Not IsNull(DLookup("[BL]", "Tracking", "[BL] = '" & Me!BL & "'"))) Then
Select Case MsgBox("The BL # you entered already exists. Choose OK to go to Edit, or Cancel to terminate this action", vbOK + vbCritical, "Duplicate BL Number")
Case vbOK
Cancel = False
BL.Undo
DoCmd.OpenForm "Main Form", acNormal, , "[BL]= Forms![Main Form1]![BL]"
Case vbCancel
Exit Sub
End Select
End If
End Sub
Private Sub BL_BeforeUpdate(Cance As Integer)
If (Not IsNull(DLookup("[BL]", "Tracking", "[BL] = '" & Me!BL & "'"))) Then
Select Case MsgBox("The BL # you entered already exists. Choose OK to go to Edit, or Cancel to terminate this action", vbOK + vbCritical, "Duplicate BL Number")
Case vbOK
Cancel = False
BL.Undo
DoCmd.OpenForm "Main Form", acNormal, , "[BL]= Forms![Main Form1]![BL]"
Case vbCancel
Exit Sub
End Select
End If
End Sub