Len Piwowar
02-09-2006, 08:20 PM
Just started playing with Access.VBA and trying to create a menu system. I setup tables where each one is used to fill a listbox to create a simple menu. When the 1st listbox is selected an (event procedure) click runs a sub procedure which passes the Bound value to a varable and becomes the next menus name. I then make the next Listbox menu visible. And based the that selection the next menu becomes visible.
Question:
If Menus1, Menus2, Menus3 and Menus4 are Visible and Menus2 is clicked I would like Menus3 and Menus4 to have visible = False using something like a for next statement. I tried Using a procedure like:
For X = 2 to MenusOpened
MenuNam = "Menus" & X
MenuName.visible = False
Next
But the reference to the menus name will not work??
I have attached the current Elect Menus DB and code but haven't been able to have the menus to the right of the current one close when a menu on the left is selected.
Thanks in advancehttp://vbaexpress.com/forum/images/smilies/102.gifhttp://vbaexpress.com/forum/images/smilies/102.gif
Question:
If Menus1, Menus2, Menus3 and Menus4 are Visible and Menus2 is clicked I would like Menus3 and Menus4 to have visible = False using something like a for next statement. I tried Using a procedure like:
For X = 2 to MenusOpened
MenuNam = "Menus" & X
MenuName.visible = False
Next
But the reference to the menus name will not work??
I have attached the current Elect Menus DB and code but haven't been able to have the menus to the right of the current one close when a menu on the left is selected.
Thanks in advancehttp://vbaexpress.com/forum/images/smilies/102.gifhttp://vbaexpress.com/forum/images/smilies/102.gif