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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Querys to the same report 1

Status
Not open for further replies.

3734kumo

Programmer
Mar 18, 2002
12
0
0
US
I have several record selections all of which use the exact same report. How do I change the record source of the report? I want to use a form to select the desired set and on 'click' pass it to the report. It seems so easy in other languages. I don't know why I can't see it in the books.
 
If you create a query that asks for a field from your Form, and have your report use the data from the query you can accomplish what you want. Just set the desired query field critera to "=[Form]![Your Form name]![The item you want to be able to select]. And for your select box, use the OnClick property to assign the value of the to a textbox for example. The query pull the data from your textbox, and your form will pull the data from your query. Thats it!
 
Set up a global variable of type string.

When you go to create a report put the RecordSource string into the global variable, then open the std Report.
Then in the Report_OnOpen event set the Report's RecordSource = global variable.

QED



G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top