No Luck

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.
 
G

Guest

Your missing your closing single quotes around Staff Number =
and Year =
You have them OK around Month =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top