Add ability to print report while viewing in popup / modal format

I have an Access file that users navigate through forms that popup in "always on top" format. From some of those forms I give them a button that brings up a preview of a report that is also a popup in "always on top" format. Since they can not get to a print menu due to the "always on top", is there a way to allow printing of the report. I was thinking about a command button on the report, but cant see where that's possible.

Thanks, Dale
Dale LoganConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcnuttlawCommented:
You could MsgBox the user on the Report--Open event informing/reminding that they can print by right-clicking on the report preview and selecting Print or use the keyboard shortcut CTRL-P to bring up the print dialog.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale LoganConsultantAuthor Commented:
A message box is a nice idea. However, I tried to make the appearance of the app cleaner by not showing any toolbars which does not allow the user to right click. If I can't come up with a better solution, then I guess I can turn that back on.

Is it not possible to add a command button to a report?
0
mcnuttlawCommented:
I'm not aware of a method of putting a command button on a report.  So I instruct my users to use the keyboard shortcut.  
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Mike EghtebasDatabase and Application DeveloperCommented:
From any event, on click of a button event forexample, you can have:

 DoCmd.OpenReport "ReportName", acPrint
                                       ^-- supply report name you want to print it
 
0
mcnuttlawCommented:
eghtebas,

I assume you mean BEFORE the report is in preview?  

I'm curious also per the original question if there is any method of putting a command button INTO the report.
0
Mike EghtebasDatabase and Application DeveloperCommented:
re:> if there is any method of putting a command button INTO the report.

I tired shortly ago. I allows to add a button to a report but it doen't show any events for it hence making it totally useless. Insead of a button, what is common is adding your own custom menu for printting a report (this menue shows when the report is in preview).

re:> I assume you mean BEFORE the report is in preview?

Yes.

0
Dale LoganConsultantAuthor Commented:
I figured that adding a command button to a report was not going to work, but wanted to ask "Experts". Ultimately I am just looking for a way that will be easy and obvious to users the ability to print.
0
Dale LoganConsultantAuthor Commented:
I will search to see how to add a menu that shows when the report is in preview. I assume it's fairly easy.
0
Mike EghtebasDatabase and Application DeveloperCommented:
You can use the code provided to primt if the printing will be done from a form before preview. If it is after preview, you need to add a menu to your report object.

Which one is your choice. Do you want to add a custom menu bar?

Mike
0
Dale LoganConsultantAuthor Commented:
I would like to let the user view the report first. I am thinking that most will not want to print very often, but may sometime. So, I guess a custom menu bar would be preferred.
0
mcnuttlawCommented:
There's already a menu - right click-print.  Or even the keyboard shortcut CTRL-P.

However, I'd be interested in the custom menu bar.
0
Mike EghtebasDatabase and Application DeveloperCommented:
- Open the report in Design view.
- Select View/Toolbars/Customize
-Select Toolnars/New to get Custom 1  <-- rename if you whish
-Select comman Tab
- Select File
-Scroll down in the right section until you get to print icon.
-Drag it to you Custom 1 toolbar
close all to get to your report's design view.

On the property sheet, locate Tollbar property. Enter that property and add Custom 1 toobar using the drop box to its right.

Save and close the report. Previw it to see the tollbar you just created. Drag it yo its lication if you whish it eill remain there.

Good Luck.

Mike
0
Mike EghtebasDatabase and Application DeveloperCommented:
The description above is for toolbar I hope it is acceptable. Menu bar is built basically the same way.
0
mcnuttlawCommented:
Doesn't quite work.  My situation is the same as the original question in that the report preview is popup-modal.  The custom toolbar is not accessible.
0
Mike EghtebasDatabase and Application DeveloperCommented:
re:> popup-modal

Can you change modal to no just to install the toolbar an test it few times then change it back to modal yes?
0
mcnuttlawCommented:
It does work when the report is off modal but we were hoping for a toolbar/menu during modal.
0
Dale LoganConsultantAuthor Commented:
OK, this is turning into something that's really not worth the trouble. I created the custom 1 toolbar. Now the toolbar shows all the time throughout the database with the exception of when a report is being previewed. I guess I did something wrong. Unless we can come up with a quick fix, I am starting to like the right click message in a message box.
0
mcnuttlawCommented:
Too bad a report couldn't be in a subform and then the mainform could house the requested command buttons.
0
Mike EghtebasDatabase and Application DeveloperCommented:
if you have done:

"On the property sheet, locate Tollbar property. Enter that property and add Custom 1 toobar using the drop box to its right.",

it should show up only when the report is in preview.

Mike
0
mcnuttlawCommented:
Very interesting.

Set the report to Popup no, Modal yes and the only toolbar that is visible is the Custom toolbar.

The report still acts "modal".

Thanks Mike.
0
Dale LoganConsultantAuthor Commented:
mcnuttlaw,

I thought you had it. Everything worked just as you said. Only problem, though is the report opens behind a popup form. Darn it!

Dale
0
mcnuttlawCommented:
0
Mike EghtebasDatabase and Application DeveloperCommented:
Well, if the report has been opened behind a modal popup form, code like:

DoCmd.OpenReport acReport, "Report1"

behind a button on the modal form shoud do the job (print it).

You may have to use:

DoCmd.Close acReport, "Report1"
DoCmd.OpenReport acReport, "Report1"

Mike
0
mcnuttlawCommented:
What worked for me...

Set the "popup" form that calls the report...

Popup no
Modal yes

Set the report itself...

Popup no
Modal yes

The report goes on top of the popup form (which is on top of the form/switchboard that called it) and the custom toolbar is the only toolbar exposed.
0
Mike EghtebasDatabase and Application DeveloperCommented:
So you have a solution. Kind off easy but challanging situation.
0
mcnuttlawCommented:
Thanks for sticking with us on this one Mike.  You definitely put us on the right track.
0
Dale LoganConsultantAuthor Commented:
Sorry, but I thought I had already closed this question out. Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.