The old toolbar problem

danikuper

Registered User.
Local time
Today, 15:31
Joined
Feb 6, 2003
Messages
147
Hi!

I've read lots of threads on how to hide and show toolbars and tried everything possible however I am still having problems with my application.

Here's what's happening. I have security in place so every user has one userID and passwd. There's a startup form in place that checks which user is logged in and opens the appropriate switchboard.

Now I want to hide the menu bar and have displayed only a custom toolbar (called Cash) I created.

In the Open event of my startup form I included the following:

Private Sub Form_Open(Cancel As Integer)
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Cash", acToolbarYes

DoCmd.Close
If CurrentUser = "salesrep" Then DoCmd.OpenForm "Welcome - Sales"
If CurrentUser = "accting" Then DoCmd.OpenForm "Welcome Accounting"
If CurrentUser = "mngrs" Then DoCmd.OpenForm "Welcome - Managers"

End Sub

If I open the database as someone from the Admins group and double-click the startup form, when it opens it does exactly what the code tells it to do: hide menu bar and show Cash toolbar. However when the user (salesrep, for example) logs in, nothing happens with the toolbars.

Any ideas?! Please? :confused:

Thanks!!!!!
 
why dont you assign the toolbar 'cash' to your 3 forms
in design view
then on your open event for the forms hide the
menu toolbar
 
bjackson,

that's a good idea however I also tried it and it didn't work...

THEN, I started thinking about my startup options and I found out that if the "Allow built-in toolbars" option was unchecked my code wouldn't work. I activated this option and it all started to work!!!

I don't know if this is the right thing to do but if you have the "Allow built-in toolbars" unchecked, you cannot hide the menu bar.

Now everything works!!!

Thanks for the advice anyways! :)
 

Users who are viewing this thread

Back
Top Bottom