Acess 97 toolbar help wanted

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TETLEY

    Acess 97 toolbar help wanted

    I have created a database and have a form containing unbound drop down
    lists that I use as the source for filters.

    Does anyone know how I can put the drop down lists from my form into a
    toolbar ?
  • Rich P

    #2
    Re: Acess 97 toolbar help wanted

    Goto View/Toolbars/Custom/New. I created a toolbar here called
    "CBtest". Make sure you have a reference to Microsoft Office X in
    Tools/References otherwise Access won't recognize Commandbar or
    CommandbarContr ol. Then just copy and paste the routine below. This
    will create a dropdown combobox. You can get more information in the
    Access Help files under Commandbar.

    Sub CmdBrStuff()
    Dim CB As CommandBar, cbCtl As CommandBarContr ol
    Set CB = CommandBars("CB test")
    Set cbCtl = CB.Controls.Add (Type:=msoContr olDropdown)
    cbCtl.Caption = "DropDown"
    cbCtl.Style = msoComboLabel
    cbCtl.Width = 200
    cbCtl.AddItem "First", 1
    cbCtl.AddItem "second", 2
    cbCtl.AddItem "third", 3
    End Sub

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    Working...