Hi,
I have a little problem.
If I do following code in VBA, and try to run a report, it works fine, and it filters all the records for the name Jason.
sCriteria = "[Name]= 'Jason'"
stDocName = "Query"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
But, when I do the following code:
strTest = "Jason"
sCriteria = "[Name] = '" & strTest & "'"
stDocName = "Query"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
I get input box that asks for Parameter Value for Name field.
What am I doing wrong?
Thanks,
Dragan
I have a little problem.
If I do following code in VBA, and try to run a report, it works fine, and it filters all the records for the name Jason.
sCriteria = "[Name]= 'Jason'"
stDocName = "Query"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
But, when I do the following code:
strTest = "Jason"
sCriteria = "[Name] = '" & strTest & "'"
stDocName = "Query"
DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
I get input box that asks for Parameter Value for Name field.
What am I doing wrong?
Thanks,
Dragan