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!

Set Recordsource based on which button is pressed.

Status
Not open for further replies.

kb178

IS-IT--Management
Aug 16, 2001
83
0
0
US
I'm not sure if I'm going about this the right way, but I have two fields called Spkr1 and Spkr2. Both need the same reports run. Is there a way to run the same report based on whether I press the Sprk1 button or the Spkr2 button? I tried setting the recordsource from the form to the report, but couldn't get that to work. And I also thought of setting the recordsource to grab which button had the focus on the form. But what is the correct code to find what has the focus on the form?
Thanks for any help,
Kristen
 
Hi,
You can use a form to set a filter for the underlying query. I wrote two FAQ's on this technique. One of them uses filter to send the criteria directly to the report (faq703-2657). The other technique sends one or more criteria items to the query (and the query is the recordsource for the report). That is faq703-2696

HTH, [pc2]
Randy Smith, MCP
California Teachers Association
 
Thanks... I wound up creating a union query to create two records, the first with spkr1, the 2nd having spkr2. Then, with your strfilter example above, I created the filters based on whether spkr1's button was pressed, or spkr2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top