Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error (comma) in query expression

Status
Not open for further replies.

mjd2007

Programmer
Mar 6, 2007
4
US
Hello all. I have an error that has just showed up. The error is as follows:

Code:
Microsoft JET Database Engine error '80040e14' 

Syntax error (comma) in query expression 'id = 1,382'. 

/Timesheet/EQ_EditTime.asp, line 26

Here is the query:

Code:
SELECT * FROM tblEqMilesHours  WHERE id = " & RecId & "


... and I think that it has something to do with the 'id' being a four digit number. In the database it is set up as an autonumber. What do I need to do to get rid of this error?

Thanks,

Parallon
 
Do you have the autonumber displaying in a text box? Is there a format set on the text box?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you for your time. I finally got it by changing the variable from [red]RecId[/red] to [red]cInt(RecId)[/red]

Thanks again,

Parallon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top