Automatically Return Parameter Query as a Report

mestst64

Registered User.
Local time
Today, 10:03
Joined
Mar 6, 2006
Messages
22
I created a combo box that runs a parameter query based on the name entered in the box.

Is there some way to return the results as a report instead of in datasheet view?

I'm wondering if inserting some sort of code into the event procedure of the "OK" button (which launches the query) would work.

Would greatly appreciate help---
 
If you want to view report like "SQL code" ,
use this code -->

Dim rs As DAO.QueryDef
Set rs = CurrentDb.QueryDefs(Me.RecordSource) ' Me.RecordSource 's just an example. It depends on you !
Me.SQLview = rs.SQL
Set rs = Nothing

Is this what you want to try, friend ? :p
 
Create a report based on your query then in the onclick event of your ok button replace the code that calls the query calling the report instead
 
Thanks Smart!!! This generated a report just like I had hoped! However, instead of displaying it on the screen, it sent it directly to the printer. Any advice on how it can be previewed first; with the option to then print it or close it?

:) Thanks again for bringing it this far---
 
Got it figured out (with help :) )

DoCmd.OpenReport "MyReportName", A_PREVIEW
 

Users who are viewing this thread

Back
Top Bottom