Yes, I am confused. I have a macro attached to the OK command button on my
form which opens a specific report with the specified date range. If I use a
macro to open the form, how do I open a report? In other words, how do I
program the OK button to work with any report since I have to specify a
report name using the OpenReport action?
If macros are too simplistic for this, how can I code this using VBA?
> Through macros? Probably.
>
[quoted text clipped - 23 lines]
> > or VBA--to make this one dialog box work for multiple reports? Thanks in
> > advance!
On the line right above your OpenReport action, use a OpenForm action.
Set the Window Mode to Dialog. This will cause the macro to pause
while the form is open.
On the OnClose event, use VBA code, and set the visibile property of
the form to false. This hides the form, but leaves it open for your
query to access the values. Once the form is hidden, the macro runs
the next line, which opens the report. The recordsource of the report
is the query with the conditions set, which evaluate to find the form
you have hidden, and enters those values.
After the report open action, you should close the form that has the
date ranges with a standard Close action.
Does that help?
Chris
> Yes, I am confused. I have a macro attached to the OK command button on my
> form which opens a specific report with the specified date range. If I use a
[quoted text clipped - 32 lines]
> > > or VBA--to make this one dialog box work for multiple reports? Thanks in
> > > advance!- Hide quoted text -- Show quoted text -
msgulf - 29 Jan 2007 14:12 GMT
Yes it does; thank you!
> On the line right above your OpenReport action, use a OpenForm action.
> Set the Window Mode to Dialog. This will cause the macro to pause
[quoted text clipped - 50 lines]
> > > > or VBA--to make this one dialog box work for multiple reports? Thanks in
> > > > advance!- Hide quoted text -- Show quoted text -