error = Expected end of Statement?

Susan Allen Wyoming

Registered User.
Local time
Today, 19:29
Joined
Feb 15, 2001
Messages
22
I am trying to copy some code that Chris gave me earlier this morning, but I have no programming experience.

Does anybody know why I am getting an error "expected end of statement" with the following code?

strSql = "Select DescripName,ProdSize,ProdRetail,ProdID,POID,OrderTotal FROM qryOrders" _
&"WHERE POID = " &Me.POID&";"

Also when I create variables the "tip thingys pop up for As Recordset, As String, As Integer, etc., but when I did Dim dbs As Database nothing came up. I only saw DataAccessPage....is there a difference?
 
Try it like this:

strSql = "Select DescripName,ProdSize,ProdRetail,ProdID,POID,OrderTotal FROM qryOrders" _
& "WHERE POID = " & Me.POID & ";"

Ya need to put spaces around them "&"s (least that got rid of the syntax errors for me)...

As for the Dim dbs as Database,

I saw Database in the help tips but didn't see DataAccessPage. Hmmm.

Doug.
 
Thank you!!

R U working with 2000 or 97? I am in Access 2000. I see AsAccess, AsInteger...everything but AsDatabase.

sue
 
'Ol dopey me.....I just found out that I have to have DAO 3.6 Object Library checked in the Tools, References of the Code window.

Thanks for your help.

Adding spaces to the code stopped the syntax error too.

Muchas Gracias
 

Users who are viewing this thread

Back
Top Bottom