Hi all! For some reason I cannot figure our why my CommandBar buttons aren't working. I'm pretty certain that it has something to do with the
Item.Key part, but I just cannot figure out what to put in place of that bit. Any ideas?
Sub InitCommandBar()
Dim mnuMain As CommandbarLib.CommandBarMenuBar
Dim mnuFile As CommandbarLib.Item
Dim mnuEdit As CommandbarLib.Item
Set mnuMain = CommandBar1.Controls.Add(cbrMenuBar, "MainMenu")
'add File menu items
Set mnuFile = mnuMain.Items.Add(1, "mnuFile", "File")
mnuFile.SubItems.Add , "mnuBackup", "Backup DB"
mnuFile.SubItems.Add , "mnuExit", "Exit"
'add Help menu items
Set mnuEdit = mnuMain.Items.Add(2, "mnuHelp", "Help")
mnuEdit.SubItems.Add , "mnuAbout", "About"
End Sub
Private Sub CommandBar1_ButtonClick(ByVal Button As CommandbarLib.CommandBarButton)
Select Case Item.Key
Case "mnuBackup"
'Add mnuBackup procedure code here.
Case "mnuExit"
App.End
Case "mnuAbout"
'Add mnuAbout procedure code here.
End Select
End Sub