I am trying to get this to work, so the form has this and i want it to promp message if the customer is already on the database, but this isnt working it prompts even if they are not
Private Sub AccountNo_BeforeUpdate(Cancel As Integer)
Dim dr As VbMsgBoxResult
If (Not IsNull(DLookup("[Account No]", "Master", "[AccountNo] ='" & Me!AccountNo & "'"))) Then
dr = Dialog.Box("A request is already on the database - are you sure you wish to add another? ", vbYesNo + vbQuestion, "Confirm Action")
If (dr = vbYes) Then
End If
If (dr = vbNo) Then
Me.Undo
DoCmd.close acForm, Me.Name
Private Sub AccountNo_BeforeUpdate(Cancel As Integer)
Dim dr As VbMsgBoxResult
If (Not IsNull(DLookup("[Account No]", "Master", "[AccountNo] ='" & Me!AccountNo & "'"))) Then
dr = Dialog.Box("A request is already on the database - are you sure you wish to add another? ", vbYesNo + vbQuestion, "Confirm Action")
If (dr = vbYes) Then
End If
If (dr = vbNo) Then
Me.Undo
DoCmd.close acForm, Me.Name
Last edited: