Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable Database Window button In Print Preview? ((a2k (9.0.6926) SP-3 Jet 4.0 SP-8) )

    On db startup is there a way in VBA code to automatically disable (uncheck) Database Window button from Print View Built-inToolbar

    I can do this manually in Print Preview by:

    1. Select More Buttons
    2. Add or Remove Buttones
    3. Ubcheck Database Window

    Thanks, John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Disable Database Window button In Print Preview? ((a2k (9.0.6926) SP-3

    You can put a line of code in the On Load event procedure of the startup form of the database, or in a function called from a macro called AutoExec:

    CommandBars("Print Preview").Controls("Database window").Visible = False

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable Database Window button In Print Preview? ((a2k (9.0.6926) SP-3

    Thanks Hans, works great!

    Is there a command to do the same with

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Disable Database Window button In Print Preview? ((a2k (9.0.6926) SP-3

    To disable "More Buttons", you'll probably have to turn off the ability to customize toolbars in Tools | Startup...

    Here is some quick & dirty code to list the controls of a command bar (toolbar/menu bar). It's just for development purposes, no fancy interface, no error handling:

    Sub ListControls()
    Dim strCbr As String
    Dim ctl As CommandBarControl
    strCbr = InputBox("Which command bar?")
    If strCbr = "" Then Exit Sub
    For Each ctl In CommandBars(strCbr).Controls
    Debug.Print ctl.Caption
    Next ctl
    Set ctl = Nothing
    End Sub

    Click somewhere in this procedure and press F5. Specify the name of a command bar, e.g. Edit or Print Preview and click OK. You'll see a list of the controls in the Immediate window.

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable Database Window button In Print Preview? ((a2k (9.0.6926) SP-3

    Thanks

Posting Permissions

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