S
susiew32
I'm using Access 2003. I'd like to put a combo box on an existing toolbar
that has command buttons on it. I don't see that there's a way to do it via
Tools, Customize, like you can if you want to add a command button.
So I did it in code:
Dim cmdBar As CommandBar
Dim combo As CommandBarComboBox
Set cmdBar = CommandBars("MyToolbar")
Set combo = cmdBar.Controls _
..Add(msoControlComboBox, , , , True)
With combo
..AddItem "x", 1
..AddItem "y", 2
..AddItem "z", 3
..Caption = "Location"
..DropDownLines = 3
..DropDownWidth = 75
..ListIndex = 0
end with
But when I close the application, the combo box on my toolbar goes away. Is
there a way to save the toolbar with the combo box, so that I don't have to
recreate it each time I open the application?
Thanks in advance.
that has command buttons on it. I don't see that there's a way to do it via
Tools, Customize, like you can if you want to add a command button.
So I did it in code:
Dim cmdBar As CommandBar
Dim combo As CommandBarComboBox
Set cmdBar = CommandBars("MyToolbar")
Set combo = cmdBar.Controls _
..Add(msoControlComboBox, , , , True)
With combo
..AddItem "x", 1
..AddItem "y", 2
..AddItem "z", 3
..Caption = "Location"
..DropDownLines = 3
..DropDownWidth = 75
..ListIndex = 0
end with
But when I close the application, the combo box on my toolbar goes away. Is
there a way to save the toolbar with the combo box, so that I don't have to
recreate it each time I open the application?
Thanks in advance.