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

Creating Query from inside the FORM

Status
Not open for further replies.

Compuboy

Programmer
Jun 8, 2004
38
US
I have the SQL statement I Want to use to generate a query when in the form. Is there any way I can add a button to use this SQL statement to make a printable query??
 
Hi

Yes, see DoCmd.OpenQuery in help, which will allow yo to dispaly the query as a datasheet, or consider making a report and setting the Recordsource of the report to the SQL string you have built (in the OnOPen Event of the report).

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
You can assign a macro to a command button that uses the OutputTo action to output the results of the query to an RTF, HTML, text or Excel file. The user could then open the output file and print it.

[shadeshappy] Cruising the Information Superhighway
(your mileage may vary)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top