Ok, here's an interesting little problem (I'm using Access 2000).
I have a string variable named strAcctKey. I am trying to create a querydef that I can reuse because I need to create a loop and the value of strAcctKey changes as the loop goes through the records. Here's what I have:
Set qdf = dbs.CreateQueryDef("qryCustItem", _
SELECT * qrySomeQuery WHERE AcctKey = " & strAcctKey)
Unfortunately, what it's doing is it's putting the value of strAcctKey in the criteria but not using QUOTES so Access is saying "Wrong Datatype, Dummy!"
Can anyone tell me how I can get the &!%*&@! thing to put the quotes in and run the query?
Thanks!
prgmrgirl
I have a string variable named strAcctKey. I am trying to create a querydef that I can reuse because I need to create a loop and the value of strAcctKey changes as the loop goes through the records. Here's what I have:
Set qdf = dbs.CreateQueryDef("qryCustItem", _
SELECT * qrySomeQuery WHERE AcctKey = " & strAcctKey)
Unfortunately, what it's doing is it's putting the value of strAcctKey in the criteria but not using QUOTES so Access is saying "Wrong Datatype, Dummy!"
Can anyone tell me how I can get the &!%*&@! thing to put the quotes in and run the query?
Thanks!
prgmrgirl