View Single Post
  #3 (permalink)  
Old October 26th, 2007, 12:10 PM
Loralee Loralee is offline
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Lisa,
I tried looking up the order of events for a subreport but could not find when the subreport loads in relation to the main report. If it were a form, the subform loads before the main form. If the same thing happens with reports (the subreport "loads"/opens first) you might be able to insert your parameter value at that point. Have you tried stuffing your parameter from the dialog form via a variable to the subreport by using the Open Event of the subreport(report property page?)

Here is what HELP says for Order of Events for REports: (to maintain the contents I just pasted the whole thing)
Order of events for reports and report sections:
Events occur for reports and report sections when you open a report to print or preview it, or close a report.
Events for reports
When you open a report to print or preview it and then later close the report or move to another window in Microsoft Access, the following sequence of events occurs for the report:
Open Þ Activate Þ Close Þ Deactivate
When you switch between two open reports, the Deactivate event occurs for the first report, and the Activate event occurs for the second report:
Deactivate (report1) Þ Activate (report2)
The Deactivate event for a report also occurs when you switch from the report to another window in Access. However, the Deactivate event doesn't occur when you switch to a dialog box, to a form whose PopUp property is set to Yes, or to a window in another application.
When you open a report that is based on a query, Access triggers the Open event before running the underlying query. As a result, you can set the criteria for the report by using a macro or event procedure that responds to the Open event. For example, the macro or event procedure could open a custom dialog box in which you enter the report criteria.
Events for report sections
When you print or preview a report, the Format and Print events occur for the report sections after the Open and Activate events for the report and before the report's Close or Deactivate events:
Open (report) Þ Activate (report) Þ Format (report section) Þ Print (report section) Þ Close (report) Þ Deactivate (report)
In addition, the following events can occur during or after formatting but before the Print event:
· The Retreat event occurs when Access returns to a previous section during report formatting.
· The NoData event occurs if there are no records displayed by the report.
· The Page event occurs after formatting but before printing. You can use this event to customize the appearance of the printed report.


Reply With Quote