Report already open

G

gr

Hi, if a have a report which record source changes
depending on users choice.
If the report is opened and the user change the critria
and press again the open report button. the report still
is the same (the record source is not changed), so before
in the on click event of the open report button I have
this code


If RptIsLoaded("rptSomething") Then
DoCmd.Close acReport, "rptSomething"
End If
DoCmd.OpenReport stDocName, acViewPreview, strFilter,
strSQL

So, I am closing and then opening again.. is there a more
efficient solution?
 
A

Allen Browne

No. That's the best way.

It is possible to change the Filter of an open report, but this forces it to
reload all its records anyway to gains next to nothing.
 

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