Accessing custom toolbar

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi,

I have an application written in Access 2000 that has custom toolbars, I now
the name of these from the code but I can seem to change them due to not
being able to right click them nor is there an option to select / edit under
any menu item when in form or design mode.

Any ideas greatly welcomed. Rob
 
It sounds like the tools->startup options where used before deploying to a
user )(this is standard, and recommend approach before you give the
database to your users. All of the things to hide, and setup what menu bars,
and what forms starts is in the tools->startup. Using these options, you can
complete hide the ms-access interface, and not have to both with security,
or even writing any code.

So, if you are using ms-access, then tools->startup options should be a VERY
familiar place where you spend time to setup your application before it goes
out to your users.

You can by-bass the start up options by holding down the shift key during
startup (and, as a developer, you will like do that all day long as you
devleoper, and hten you can exit..and re-start the application without
holding down the shift key to see how it works in "end user" mode).
 
Albert,

Thanks for this, Toolbars now revealed and I can modify. One question if I
may, do you know how to add a Print button that allows the user once clicked
to chose which pages to print.

I've add the Command button Print..... but unlike when chosen from the File,
Print.... menu item, the option to select what to print isn't there?

Any ideas? Thanks, Rob
 
You can as mentioned "steal" the existing ones, and if you steal the print
preview..then it should work.

However, I use code. The two options I use

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, or in YOUR case enter the starting/ending pages).

Note that the following code assumes the report is already open. In fact,
you should for all reports make a nice custom menu bar.

You can use:

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

Note that you can/could change the above (in either case) to prompt the user
for the start/end page..but I usually just let them use the printers built
in ability from the printer dialog to do this.

strStart = inputbox("Enter Straing page")
strEnd = inputbox("Enter Ending page")
DoCmd.PrintOut acPages, strStart,strEnd

However, I think it is too much to bother with start/end prompts..and you
best just use the above code to pop up the standard printer dialog box.

And, note that I always use/build a custom menu bar for all reports. Here is
screen shot that uses the above actual code (note the two first print
options...print to default, and print to selected printer).

http://www.members.shaw.ca/AlbertKallal/test/bu1.gif

..
 
Back
Top