Update report based on continuous form

C

Cmenkedi

Using Access 2007

I have a continuous form that I filter based on a multi-select list box from
another form. I want to be able to view a report based on the SQL that I am
using to load that form. I have tried using the method of opening the report
in design view, saving it, closing it, and then opening it back up using VBA.
This gets me where I want to be except it runs very slow. My SQL is using 13
different queries along with 2 calculations to show what I need on the
screen. The report is a mirror of what is on the screen.

Is there another way I can pass my recordsource SQL from the form to the
report?
 
D

dymondjack

Have you tried the DoCmd.OpenReport method, using the Where condition of the
SQL string as the Where Condition argument? This would require that your
report is 'PreFormatted' for that recordsource, but I wouldn't think it would
take any longer to load than the same SQL on a form.

Or, you can set the reports Recordsource property on its OnOpen event,
passing the SQL string from the form as an OpenArg (also with the
DoCmd.OpenReport method).


--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top