[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2008-02-02
27
Medium Priority
?
472 Views
Last Modified: 2013-11-28
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
0
Comment
Question by:Dale Logan
  • 11
  • 9
  • 7
27 Comments
 
LVL 2

Accepted Solution

by:
mcnuttlaw earned 2000 total points
ID: 20807795
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
 

Author Comment

by:Dale Logan
ID: 20807837
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20807857
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20808025
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20808779
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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20808973
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
 

Author Comment

by:Dale Logan
ID: 20809014
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
 

Author Comment

by:Dale Logan
ID: 20809024
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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809030
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
 

Author Comment

by:Dale Logan
ID: 20809040
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809041
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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809070
- 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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809078
The description above is for toolbar I hope it is acceptable. Menu bar is built basically the same way.
0
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809160
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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809185
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809289
It does work when the report is off modal but we were hoping for a toolbar/menu during modal.
0
 

Author Comment

by:Dale Logan
ID: 20809293
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809305
Too bad a report couldn't be in a subform and then the mainform could house the requested command buttons.
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809424
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809512
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
 

Author Comment

by:Dale Logan
ID: 20809575
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809585
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809603
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
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809643
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
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 20809728
So you have a solution. Kind off easy but challanging situation.
0
 
LVL 2

Expert Comment

by:mcnuttlaw
ID: 20809799
Thanks for sticking with us on this one Mike.  You definitely put us on the right track.
0
 

Author Closing Comment

by:Dale Logan
ID: 31427568
Sorry, but I thought I had already closed this question out. Thanks for the help.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Implementing simple internal controls in the Microsoft Access application.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question