vbprogramming
Programmer
I’m stuck, I have been working on this for too long without getting anywhere! I have an application where the user starts with a splash screen. The startup window will need menus on a tool bar at the top. When the application starts it will scan an external mdb file for a list of all the menu names to add to the tool bar. I need the menus to be totally dynamic. I have looked for hours on multiple code sites and have been unable to resolve this issue. Following is what I want the code to look like:
Public sub Form_load()
Do other non related tasks……
…..
loadMenus()
End sub
Private sub loadMenus()
Dim dbs as database
Dim rst as recordset
Set dbs = opendatabase(“C:\file etc\example.mdb”)
Set rst = dbs.openrecordset(“select * from tablename where [field] = ‘value’”)
While not rst.eof
‘?????
‘create a new dropdown menu for the toolbar with the name as defined
‘by rst.field(“Menu Name”)
‘?????
wend
End sub
The purpose for this is that I have created a common interface into many different sub programs. I want to just pass to each user the modules that they need. The user will push a button and the mdb file of menu names will be used to repopulate the menus. The end result is that I will just add a new recordset into the database and be able to with my code automatically add in a new menu.
Public sub Form_load()
Do other non related tasks……
…..
loadMenus()
End sub
Private sub loadMenus()
Dim dbs as database
Dim rst as recordset
Set dbs = opendatabase(“C:\file etc\example.mdb”)
Set rst = dbs.openrecordset(“select * from tablename where [field] = ‘value’”)
While not rst.eof
‘?????
‘create a new dropdown menu for the toolbar with the name as defined
‘by rst.field(“Menu Name”)
‘?????
wend
End sub
The purpose for this is that I have created a common interface into many different sub programs. I want to just pass to each user the modules that they need. The user will push a button and the mdb file of menu names will be used to repopulate the menus. The end result is that I will just add a new recordset into the database and be able to with my code automatically add in a new menu.