Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Posts
    81

    Question Unanswered: Disable Menu Bar On Start Up

    Do you know how can I disable all the toolbars on startup?

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    You could run the below sub on your switchboard on-load event:

    Code:
     
    Sub DisableCmdBars()
     
    	Dim cBars As CommandBars
    	Dim cBar As CommandBar
    		
    'reference your databases commandbars collection.
    	Set cBars = Application.CommandBars
       
    'loop through each commandbar in the commandbars collection
    	For Each cBar In cBars
    		With cBar
    		
    '	   if it is a tool Bar, disable it
    		If .Type = 0 Then
    			.Enabled = False
    			
    'Uncomment the below lines if you want to disable the menu bar(s) too
    '		ElseIf .Type = 1 Then
    '
    '			.Enabled = False
     
    		 End If
    		End With
       
    	Next
    'Pop-Up menus remain enabled
     
    'disable the ability to customise the toolbars (unnecessary if you disable the meneu bar)
    	cBars.DisableCustomize = True
    	
    End Sub
    Also, have a scan over the last few pages of posts - there have been a few similar posts recently.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2004
    Posts
    130
    I'm getting an "undefined user type" on the following statement:

    Dim cBars As CommandBars

    Do you have any unusual references in vba?

    thanks,

    Winston

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Exqueeze me - totally forgot - MS Office reference as I recall. Let me know if you still have probs.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Apr 2004
    Posts
    130
    That did it... thanks

    Winston

  6. #6
    Join Date
    Apr 2004
    Posts
    130
    As I said, I got it to work just fine... my users use an .mde so I am not worried about most toolbars. Is there a method to turn off just the status bar only?
    thanks,

    Winston

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Winston

    application.SetOption "show status bar", false

    can turn it on and off.
    If you look at the Tools>>Options box you can pretty well guess any other changes you can make using .SetOption
    Cheers
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Apr 2004
    Posts
    130
    Works just fine.
    Thanks again.
    Winston

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •