Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all, When my application star

Status
Not open for further replies.

tbt102

Programmer
Jan 1, 2002
61
0
0
US
Hi all,

When my application starts up it turns all standard tool bars off and turns on custom tool bars via acToolbarNo and acToolbarYes.

My users are complaining that their tool bars don't look the same after exitng my application.

I would like to capture what standard tool bars are actually on before I switch them all off so I can restore then when the user quits my application.

Is this possible?

Thanks in advance for any help.

tbt102
 
May I suggest adding a proper subject if you want people to help you. I don't know the answer to your question, sorry.
 
Hi!

A couple of thoughts: Open a hidden form when your app opens and in the close event procedure of the form reset the toolbars. Second, force the users to close Access when they exit your app. When they reopen Access the toolbars should be okay.

hth
Jeff Bridgham
bridgham@purdue.edu
 
There's gotta be a collection that contains the toolbars. Look up "Toolbar object" and "Toolbars collection" in the help to see if I'm right, and to find out what the parent objects are.

Iterate through the collection, storing info about which toolbars are open. If the collection is just a collection of open visible toolbars, store their names and re-add thm at the end of your app. If it contains all toolbars, and you just need to set a Visible property (or something comparable) for each, store the neccessary value(s) and reset them at the end of your app.

Maybe you'll want an array to store toolbar names or property values; then run through your array at app close. Or! Here's an interesting thought: Maybe you can add the toolbars to your own declared/created/user-defined collection as you delete them from the main one; then move them back when your app is done! *If*, that is, this strategy is appropriate to reality.

>>>W(H(O(o(s(h(((QuickieBoy
 
Application.CommandBars (or something similar)

When your application starts

Dim cbr as CommandBar
For Each cbr in Application.Commandbars
'Check if cbr is visible/active and store result to table
Next cbr

Then, when your application closes, reverse the procedure.

rgds
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top