G
Guest
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("Claim_Number", "[Mileage]", _
"[Staff Number] = '" & Me![Combo35] _
& " AND [Month] = '" & Me!Month & "'" _
& " AND [Year] = '" & Me!Year)) Then
MsgBox "This claim has already been entered", vbOKOnly
Cancel = True
End If
End Sub
Run time error '3075'
Syntax error (missing operator) in query expression '[Staff Number] = '34417
AND [Month] = 'September' AND [Year] = '2005'
Thats the message I get. I decided to take out the date receieved line.
Below are the details of the field's , data types
Primary Key Claim Number = Autonumber
Staff Number (Foreign Key From Employee Table) = Text
But this is entered using a combo box field. Called Combo35 Label is Staff
Member
Date Received = Date
Miles = Number
Month = Text
Year = Text
Thanks very much for helping me.
If Not IsNull(DLookup("Claim_Number", "[Mileage]", _
"[Staff Number] = '" & Me![Combo35] _
& " AND [Month] = '" & Me!Month & "'" _
& " AND [Year] = '" & Me!Year)) Then
MsgBox "This claim has already been entered", vbOKOnly
Cancel = True
End If
End Sub
Run time error '3075'
Syntax error (missing operator) in query expression '[Staff Number] = '34417
AND [Month] = 'September' AND [Year] = '2005'
Thats the message I get. I decided to take out the date receieved line.
Below are the details of the field's , data types
Primary Key Claim Number = Autonumber
Staff Number (Foreign Key From Employee Table) = Text
But this is entered using a combo box field. Called Combo35 Label is Staff
Member
Date Received = Date
Miles = Number
Month = Text
Year = Text
Thanks very much for helping me.