This ia a direct link to what you need:
http://vbaccelerator.com/codelib/cpopmenu/cnewmenu.htm>I am storing a menu structue in a db. I want to dynamically create a menu based on the db. In the menu editor I have created a menu item called MyMenuItem and set the index to 0. In the Load event of the form I create a rs based on the table menu header and loop through each record to create the menu structue:
>
>For i = 1 To rs.recordcount
>Load MyMenuItem.Item(i)
>MyMenuItem.Item(i).visible = True
>MyMenuItem.Item(i).caption = menuheader.Description
>Next i
>
>This works great but now I want to add one more level deep. If I create a new menu item MySubMenu based on index 0 and indented once from MyMenuItem and loop through a rs containing menudetail the only menulist that shows the addition is MyMenuItem.Item(0)
>
>Is it not possible to add a Sub Menu dynamically?
>
>Thanks
>
>Nichole
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com