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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup function syntax error 1

Status
Not open for further replies.

vandaliarental

Technical User
Jul 17, 2000
84
US
I am trying to set a variable to a value found in another table & am getting a syntax error on [CID]='605050'.

Here's the statement:
Dim str as string
str= DLookup("[group_desc]", "TestTaxExempt", "[CID]='605050';")

I've checked the TestTaxExempt table & there is a valid string in the [group_desc] field for CID = 605050.

I've also checked the references library & DAO 3.6 Library is checked (along with visual basic for applications; MS Access 9.0 object library; OLE automation & MS ActiveX Data Objects 2.1 library).

Any help would be appreciated.

Thanks,
Connie
 
Remove the semi-colon. It's added to the end of queries by Access for no apparent reason - it's not part of SQL syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top