OpenRecordset Problem

J

jsccorps

ProductID is an Integer

Set rs = CurrentDb.OpenRecordset("Select * From [Inventory] Where
[ProductID]=" & Me!ProductID, dbOpenDynaset)

works fine. But when i try to add sorting, there is a problem (see below):

Set rs = CurrentDb.OpenRecordset("Select * From [Inventory] Where
[ProductID]=" & Me!ProductID ORDER BY AddDate DESC, dbOpenDynaset)
 
S

Steve Sanford

Try:

Set rs = CurrentDb.OpenRecordset("Select * From [Inventory] Where >
[ProductID]=" & Me!ProductID & " ORDER BY AddDate DESC" , dbOpenDynaset)



HTH
 

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