G
Guest
I have an After update Event procedure as follows:
Private Sub Envelope_Number_AfterUpdate()
If DCount("*", "[Main Table]", "[Envelope Number]=" & Me.Envelope_Number) >
0 Then
MsgBox "SORRY, THIS NUMBER IS ALREADY IN USE. IF YOU WISH TO ALLOCATE
THIS NUMBER, YOU MUST REMOVE THE NUMBER FROM THE MEMBER TO WHOM IT IS
CURRENTLY ALLOCATED. PLEASE NOTE THAT YOU MUST NOT RE-ALLOCATE ENVELOPE
NUMBERS DURING THE PLANNED GIVING CYCLE", vbOKOnly, "ERROR! MESSAGE"
Cancel = True
Me.[Envelope Number] = Null
DoCmd.RunCommand acCmdSaveRecord
End If
End Sub
This works fine, except when the user tries to deletes an existing Number,
the following message appears:
Run Time error '3075'
Syntax error (Missing operator) in query expression '[Envelope Number]=',
Is there a way I can adjust the code to prevent this?
Thanks for any help
"
Private Sub Envelope_Number_AfterUpdate()
If DCount("*", "[Main Table]", "[Envelope Number]=" & Me.Envelope_Number) >
0 Then
MsgBox "SORRY, THIS NUMBER IS ALREADY IN USE. IF YOU WISH TO ALLOCATE
THIS NUMBER, YOU MUST REMOVE THE NUMBER FROM THE MEMBER TO WHOM IT IS
CURRENTLY ALLOCATED. PLEASE NOTE THAT YOU MUST NOT RE-ALLOCATE ENVELOPE
NUMBERS DURING THE PLANNED GIVING CYCLE", vbOKOnly, "ERROR! MESSAGE"
Cancel = True
Me.[Envelope Number] = Null
DoCmd.RunCommand acCmdSaveRecord
End If
End Sub
This works fine, except when the user tries to deletes an existing Number,
the following message appears:
Run Time error '3075'
Syntax error (Missing operator) in query expression '[Envelope Number]=',
Is there a way I can adjust the code to prevent this?
Thanks for any help
"