knavlekar said:
I want to display a report which is coming from a criteria query. I want to
give the criteria from a form (combo box selection. for example: company
name). I do not know how to build a report which gets a criteria from a
form.
Check Help for the DoCmd.OpenReport statement, and look at its
WhereCondition or Filter arguments. That will do what you want.
Alternatively, you could pass the criteria/limiting information in the
OpenArgs argument of DoCmd.OpenReport, then modify the Report's RecordSource
in the Report's Open event. Forms have had OpenArgs for many versions of
Access, but they were new to Reports in Access 2002.
So, if you are using Access 2000 or older, this is not an alternative -- you
would have to pass the information in some other way; a public variable, a
user defined Property of the Report, or make sure it is available in a
Control in an Open (but not necessarily visible) Form.
Larry Linson
Microsoft Access MVP