show standard office toolbars when a form is opened

N

Nhan

Hi,
in runtime, when a data form is opened, I want to show all standard
toolbars, which access also show, when a form is opened (such as "Form
View", "Formatting (Form / Report)", and when user changes to Datasheet
view, access show automatic the toolbar "Formatting (Datasheet)").

in runtime, when my code opens a form, Access don't shows these toolbars.
When I show self these toolbars with my code, then I must hide them, when
the users change the view, that is too complex (not comfortable).

Thanks for any help
Nhan
 
R

Rick Brandt

Nhan said:
Hi,
in runtime, when a data form is opened, I want to show all standard
toolbars, which access also show, when a form is opened (such as "Form
View", "Formatting (Form / Report)", and when user changes to Datasheet
view, access show automatic the toolbar "Formatting (Datasheet)").

in runtime, when my code opens a form, Access don't shows these toolbars.
When I show self these toolbars with my code, then I must hide them, when
the users change the view, that is too complex (not comfortable).

Thanks for any help
Nhan

Not sure I understand. In the runtime environment all built in toolbars and
menubars are not available at all regardless of whether you run code to show
them or not. (unless this has changed).

You can use the menubar and toolbar properties of each form and report. This
will automatically show them when the object is opened and hide them when
closed.
 
N

Nhan

Not sure I understand. In the runtime environment all built in toolbars and
menubars are not available at all regardless of whether you run code to show
them or not. (unless this has changed).

OK, I didn't know this
You can use the menubar and toolbar properties of each form and report. This
will automatically show them when the object is opened and hide them when
closed.
OK, but I can't give 2 or 3 toolbarnames at the same time, can I?
 
J

JP

You can show and hide toolbars through the DoCmd.ShowToolbar command.
Select acToolbarNo when you want the toolbar hidden, acToolbarYes when you
want the toolbar shown, and acToolbarWhenApprop" when you want Access to
decide when to show it. You could, for example, put the code to show the
toolbars into the open event of the form, and put the code to hide the
toolbars into the close event for the form.

Be aware that many of the commands on the standard toolbars are not
appropriate for normally open data forms and may not work or may give
strange results.
 
A

Albert D. Kallal

Try downloading my sample here:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

(grab the 3rd one "ms-access interface hidden"

Note how all the menu bars change from form to form, and note how even the
reports show their own menu bars.

All of the above works perfectly in the standard version, and also the
runtime version..

It is very easy to control the menu bars...all you do is specify what menu
bar you want for each form.....

Take a look at the above example, and see how this was done...it is NOT very
much work at all
 
N

Nhan

I don't understand you.
I have downloaded your sample, but your form or report had only one menubar
or toolbar. That is not my problem.
I want to show at the same time some toolbars for a form. When I do it with
code, then I must hide the toolbars self, when the form is deactivated. We
can do this in Form_Activate and deactivate, I know, but when many forms are
opened at the same time, the control must be exact.

..
 
A

Albert D. Kallal

Nhan said:
I don't understand you.
I have downloaded your sample, but your form or report had only one
menubar
or toolbar.

Yes, but note how each form you load shows *DIFFERENT* options. In fact, the
point here is that I did not need code to change the menu shown for each
form. Further, when I launch the report, I did not need code to "hide" the
menus for the "report menu" to show.
code, then I must hide the toolbars self, when the form is deactivated. We
can do this in Form_Activate and deactivate, I know, but when many forms
are
opened at the same time, the control must be exact.

My above sample should work just fine if you also specify the tool bar to
show for a particular form. The same concepts and ideas used in my sample
will work just fine if you were to include some tool bars for each of those
forms. And, when you switch between forms, the menu + tool bar shown will
switch for you without code....
 

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