How do you make a custom toolbar for a report?

B

boblarson

Check out my Quick tutorial on how to create a custom popup menu and when the
instructions tell you to check the popup checkbox, don't do it and you should
be able to figure out the rest (I'm working on getting an actual tutorial up
for this, but this should do for you until then):

http://www.btabdevelopment.com/main...rtcutmenuAccess20002003/tabid/62/Default.aspx


--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 
A

Albert D. Kallal

You simply build a *NEW* menu bar, and then specify that one menu bar for
all reports....

You notice that I have a email button on the report. You could even add a
"pdf" button, and use Stephens example pdf code.

So, I don't actually modify the menu bar..I simply created a new one....

If you wish..you can import that menu bar into your existing
applications..and use it

(just go file->get external data---import)...

You note the "advanced" button to include menu and tool bars for the
import....
(don't forget to import the standard code modules..as those menu bar buttons
use code from the standard code module).

So, noting special was done...just created a standard menu bar...and used
that for the report....

bring up that sample report in design mode..and you see in the "other" tab,
the menu bar is specify in the settings (property sheet...other tab).

The select object command is needed to fix a "focus" bug if you have a form
with a timer function.

For the code that pops up the printer dialog (so the user can change
printers etc). (that is the 2nd button, the code is:

On Error Resume Next
DoCmd.SelectObject acReport, Screen.ActiveReport.Name
DoCmd.RunCommand acCmdPrint

The select object command is needed to fix a "focus" bug if you have a form
with a timer function.

The code to print right to the printer while in preview mode can be:

On Error Resume Next
Dim strReportName as string
strREportName = Screen.ActiveReport.Name
DoCmd.SelectObject acReport, strReportName
DoCmd.PrintOut acPrintAll

So, the above code is for the 1st button (Print to a default printer).

Note in the sample you are looking at, the 1st button does not actually use
the above code..but, I simply swiped the print dialog button from an
existing menu bar (so, it actually uses the built-in print command, but I
likely for that example should have used the above code for the button.

Do note that the source code for the menu item that pops up the printer
dialog IS included in the standard code modules in that example (take a look
at the module called RidesReprots).

So, you just have to start playing around and building custom menu bars.
(right click on a menu bar...and select customize). Remember, to shift-key
into the database when you do this....
 

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