Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameter to a report

Status
Not open for further replies.

tredeker

IS-IT--Management
Joined
Feb 5, 2002
Messages
5
Location
US
All,
I've created 2 forms: 1st form lets user select filter criteria and 2nd form appears with record details using the OpenArgs to set the SQL where clause.

I want to do the same, only show a report rather than a form. The catch is that forms don't have the OpenArgs property. How do I pass the selection criteria to a report?

Thanks,
TR
 
sorry...the second paragraph should read "...reports do not have the OpenArgs property". I'm currently using the OpenArgs property in the form_open section.
 
Keep the SQL for the report query as a string in the cmdOpenReport_Click event.

Build the Where clause the same way you do for the form and then append it to the SQL:
strReportSQL=strReportSQL & strWhereClause

then open the report and then recordsource to the SQL string and then make the report visible.
Rott Paws
 
works like a charm --- thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top