View Full Version : error = Expected end of Statement?


Susan Allen Wyoming
03-22-2001, 01:40 PM
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,OrderT otal 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?

Susan Allen Wyoming
03-22-2001, 01:42 PM
PS - I feel like a total idiot!!!

DALeffler
03-22-2001, 02:33 PM
Try it like this:

strSql = "Select DescripName,ProdSize,ProdRetail,ProdID,POID,OrderT otal 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.

Susan Allen Wyoming
03-22-2001, 02:37 PM
Thank you!!

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

sue

Susan Allen Wyoming
03-22-2001, 03:01 PM
'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