Open a Report Programmatically

ski_diva

New member
Local time
Today, 20:22
Joined
Oct 4, 2001
Messages
5
Hi there,

I think this is a simple question. I want to do the following programmatically:

I have a report with 2 subreports in it.

I want to assign my SQL code to the recordsource for each report (3 total).

I want to use the values from two text boxes (the start and end dates) in my SQL code. These text boxes are in a Form.

I want to open up my report (with the 2 subreports) from my Form.

My questions:

How do you open a Report from a Form (programmatically)?
How do you assign the SQL code to each report and subreport?

Just the preliminary code will help me get started!

Thank you!!
Andrea
 
1. Like this:
Dim stDocName As String

stDocName = "rMy_Report_Name"
DoCmd.OpenReport stDocName, acNormal

2. Assuming that you've created and saved your query, open up the Properties for your record, and put the name of your query in "Record Source".

Are you trying to write a SQL pass-through query?

[This message has been edited by Chris RR (edited 10-30-2001).]
 

Users who are viewing this thread

Back
Top Bottom