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

Print Open Query Output

Status
Not open for further replies.

mischief911

Technical User
Jan 14, 2002
21
US
Does anyone have any guidance about how to hook up a command button to send the Open query's result set to a printer?
 
Hello Mischief911,
You can create a command button on the form by creating a macro behind the button to send the Open Query result as print preview as follows:
1. Save the Open Query such as qryXXX
2. Go to Macro Tab and create a new macro.
3. In the action column find the action named OpenQuery.
4. At the bottom you will see the action arguments. Need
to fill out the arguments.
Query Name - Refer to step 1. The name of the qryXXX.
View - Select Print Preview.
Data Mode - Select Read Only.
4. Save the macro - Example: mcrPrintQuery.
5. Go to your form and insert a command button.
6. Right click on the command button and select properties.
Select the Event Tab. In the event tab go to on click and click on the right side you will see a drop down. Find and select the macro that you saved in step 4 mcrPrintQuery.
7. Close the Properites sheet and save the form and go into
form view.
8. Click the button and you should see the result of the query in print preview mode.
Hope this helps.

Benny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top