OpenReport Question

G

Guest

I'm having some trouble with the "DoCmd.OpenReport" function. I currently
have a report, and I'm using the "OpenReport" command (using Access 97) to
print the report, BUT I want to print out the report using only a certain
criteria.

For example my code reads as follows:

DoCmd.OpenReport "Report Name", acViewNormal, "Query Filter", [where
condition]

Alright, now I'm getting an error message stating my "where condition" is
not found and to check for spelling and check to see if that field is
deleted. The spelling is correct and it is not deleted. Does anyone know
exactly how to write to code to print the report and give it the condition of
printing only certain information??
 
F

fredg

I'm having some trouble with the "DoCmd.OpenReport" function. I currently
have a report, and I'm using the "OpenReport" command (using Access 97) to
print the report, BUT I want to print out the report using only a certain
criteria.

For example my code reads as follows:

DoCmd.OpenReport "Report Name", acViewNormal, "Query Filter", [where
condition]

Alright, now I'm getting an error message stating my "where condition" is
not found and to check for spelling and check to see if that field is
deleted. The spelling is correct and it is not deleted. Does anyone know
exactly how to write to code to print the report and give it the condition of
printing only certain information??

Well, some one could help you, but you haven't given the proper
information.
What is the Where condition?
Did you write it properly?
How are we to know if we can't see it?
You already have a Filter ("QueryFilter") indicated.
Doesn't that in itself filter the records?

Post back with the name of the record field that is used as criteria
as well as it's datatype.
Then someone can help.
 

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