Error in simple query when I use variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please see below query when I use any digit instead of X it works but X is
not working:

Set Rs = Db.OpenRecordset("SELECT DetailPicknote.DTime,
DetailPicknote.DDate, DetailPicknote.DetailID FROM DetailPicknote WHERE
DetailPicknote.DetailID = x")
 
Set Rs = Db.OpenRecordset("SELECT DetailPicknote.DTime,
DetailPicknote.DDate, DetailPicknote.DetailID FROM DetailPicknote WHERE
DetailPicknote.DetailID = " & x)
 

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

Back
Top