OpenReport Question

  • Thread starter Thread starter Guest
  • Start date Start date
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??
 
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.
 
Back
Top