I've been setting up a custom toolbar on start up for the application via VBA code.
I've generated, for the custom menu bar, the drop-down menus File, Edit, Window and Help and successfully added controls to each of them except for Window. I can't seem to add the funcitionality where upon opening a form it will add itself to the Window menu as an item so when it has lost focus it can be selected again.
I looped through a database default menu bar and figured out that the menu item that selects a window is of type 1, and id 830, the caption of the menu item (control) is &# Window Name
On the customized db I used the:
Expand|Select|Wrap|Line Numbers
- Set cbcCutomMenuButton = cbcCutomMenu.Controls.Add(1,830)
- With cbcCutomMenuButton
- .Caption = "&1 Main Menu"
- End With
If I generated a new application toolbar, I should be adding, for each form that is opened, a menu item into the drop down menu Window in the onopen event of the form?, with the control's onaction property set to focus the form, and on the onclose event to the form i should remove the menu item?
Is there any way to emulate the default toolbar behaviour?
Please advise, note that manually adding a menu item is not possible due to technical reasons (and because since I've been going at this thing for 3 hours without luck, and also because of my curiosity if this can be done :))
Thanks in advance and best regards,
Afro