By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,586 Members | 623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,586 IT Pros & Developers. It's quick & easy.

OpenReport with acDialog parameter

P: n/a
Hello,

In Access 2003 one can use OpenReport with the acDialog parameter to
open a report modally. However, doing this prevents the report's
toolbars from displaying. Is there a way around this?
I would like to be able to open a report modally and still allow my
users to print in the way they've become accustomed to, i.e., by
clicking on the Print button on the toolbar.

Bruce

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
br***@aristotle.net wrote:
In Access 2003 one can use OpenReport with the acDialog parameter to
open a report modally. However, doing this prevents the report's
toolbars from displaying. Is there a way around this?
I would like to be able to open a report modally and still allow my
users to print in the way they've become accustomed to, i.e., by
clicking on the Print button on the toolbar.


Bruce, have you tried just chnaging the modal property of the report to
yes? I've never had a requirement for this in my apps that I can
recall, but I just quickly did it and the report preview showed with the
tool bar. Then you don't have to worry about the windows mode argument
in the domcmd object:

DoCmd.OpenReport "MyReport", acViewPreview
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2

P: n/a

Tim Marshall wrote:
br***@aristotle.net wrote:
In Access 2003 one can use OpenReport with the acDialog parameter to open a report modally. However, doing this prevents the report's
toolbars from displaying. Is there a way around this?
I would like to be able to open a report modally and still allow my
users to print in the way they've become accustomed to, i.e., by
clicking on the Print button on the toolbar.
Bruce, have you tried just chnaging the modal property of the report

to yes? I've never had a requirement for this in my apps that I can
recall, but I just quickly did it and the report preview showed with the tool bar. Then you don't have to worry about the windows mode argument in the domcmd object:

DoCmd.OpenReport "MyReport", acViewPreview


Hi Tim,

Thanks for the suggestion but sadly it did not work in my situation. I
have a modal form that begins an import process into my database from
an external comma delimited file. If there are any warnings to be
displayed, a second modal form pops up displaying the warnings in a
listbox. If the user wants a report of these, there is a command
button that brings up a report in preview mode that he/she can then
print out. Unfortunately the two modal forms that are being displayed
at that time prevent the report from coming to the forefront unless I
open the report with the acDialog parameter or at least set the popup
property to true in the report, but setting popup to true has the
unfortunate side effect of getting rid of the toolbars. Unfortunately
setting the modal property doesn't bring the report to the forefront
when previewed from a modal form. I ended up just making the command
button print the report rather than display it in preview mode as this
made more sense anyway (they've already got the form to see the
warnings on). At any rate, thanks for the suggestion!

Bruce

Nov 13 '05 #3

P: n/a
br***@aristotle.net wrote:
Thanks for the suggestion but sadly it did not work in my situation. I
have a modal form that begins an import process into my database from
an external comma delimited file. If there are any warnings to be
displayed, a second modal form pops up displaying the warnings in a
listbox. If the user wants a report of these, there is a command
button that brings up a report in preview mode that he/she can then
print out. Unfortunately the two modal forms that are being displayed
at that time prevent the report from coming to the forefront unless I
open the report with the acDialog parameter or at least set the popup
property to true in the report, but setting popup to true has the
unfortunate side effect of getting rid of the toolbars. Unfortunately
setting the modal property doesn't bring the report to the forefront
when previewed from a modal form. I ended up just making the command
button print the report rather than display it in preview mode as this
made more sense anyway (they've already got the form to see the
warnings on). At any rate, thanks for the suggestion!


What about playing with modal and popup properties of the two forms via
the proc associated with the command button on the second modal form?

Something like (aircode):

Private Sub btnShowErrorReport_Click()

me.modal = false 'second form

'It may or my not be necessary to setfocus to the form before changing
modal property, I don't know

forms!frmImportForm.modal = false 'first form1

DoCmd.OpenReport "MyReport", acViewPreview

End Sub

The report would not have to be modal

In the on close event of the report:

Private Sub rptErrorReport_Close()

'As per the abov proc, it may or my not be necessary to setfocus to the
form before changing modal property, I don't know

'the order in which these are made modal might have some effect, I
don't know.

formsfrmError.modal = true 'second form

forms!frmImportForm.modal = true 'first form

End Sub

Whether you twiddle with the modal properties in VBA or not I would
personally redesign my process so that I could get the report preview
first. Perhaps by having the import process close all other forms and
the closure of the main form in the import process causing the closing
of any related forms or report previews.

OTOH, if the report only shows what the error form is displaying in the
list box, then going straight to the printer would be acceptable in my
opinion, anyway.

And, after having written all the above, it occurs to me that my previou
paragraph may wel be the way to go, but I'm too ticked with myself to
erase everything above it!!! 8) 8) 80
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.