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

How to use forms to send criteria to a report

How To

How to use forms to send criteria to a report

by  MasterK27  Posted    (Edited  )
This technique will eliminate the use of creating tons of queries and reports.

Step 1 Create a table called employee with these fields:

name, position

Step 2 Place this data into the employee table

John, Bus Driver
Sara, Teacher
Mike, Cook
Laura, Bus Driver
Chris, Teacher

Step 3 Save the table

Step 4 Create a query by adding both the name and position fields and put this into the position criteria:

[Forms]![Position_Form]![Position_txtbox]

Step 5 Save the query

Step 6 Create a table called postion and enter this data:

Bus Driver
Cook
Teacher

Step 7 Save the table

Step 8 Create a form called Position_Form

Step 9 In the position form add a textbox called Position_txtbox

Step 10 Link the record source of the Positiontxtbox to the data in the position table

Step 11 Create a report called Position_Report and link this report to the Position_Form

Step 12 Add this header to the report

[Forms]![Position_Form]![Position_txtbox]

Step 13 Save the report

Step 14 Add a Report button to the Position_Form and link this button to the Position_Report

Now when you go to the Position_Form you can choose which position you want to look at using the textbox. Then you can view a report on it by clicking the report button.
The report will change base on the criteria set on the form.











Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top