Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating VB Menus with code

Posted on 2002-06-30
6
Medium Priority
?
153 Views
Last Modified: 2010-05-02
Hello experts:

Id like to create a vb menu using code.  The data elements would be pulled from a database table.  I'm very comfortable with ado connectivity, just don't know how to create the menu.

Could anyone provide an example?

Thanks

E
0
Comment
Question by:escheider
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:alfanhendro
ID: 7120985
not sure whether it works on menu, but i used this for labels, list, etc.

Create the Menu as control array from the interface.
(one menu item is enough)
when you need to create a new one, just load it.
eg.
assuming the one created in the interface is has Index = 0

IndexCtr = IndexCtr + 1
Load mnuItem(IndexCtr)
mnuItem(IndexCtr).Visible = True
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 7121216
Alternatively you can done this also by using APIs:

http://www.allapi.net/apilist/apifunction.php?apifunction=CreatePopupMenu
0
 
LVL 4

Author Comment

by:escheider
ID: 7121834
alfan:

So I have to create at least one entry using the Menu Editor in order to use code?  And the initial entry I create should initiate the control array?

So lets say i want to create a menu called Reports.  I create the Heading (Reports), then create the first entry under Reports?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 54

Accepted Solution

by:
Ryan Chong earned 100 total points
ID: 7123890
Yes, you should use the Menu Editor to at least at an initiate control array menu.

First, create a Menu Parent for the control array menu, let say mMenu. Then under this mMenu, add an initiate control array menu by naming it as mReports, set its Index Property to 0 to indicate it's a member of Reports.

Then populate the mReports as get the elements from database. And at last, popup the menu to show the mReports by using PopupMenu mMenu.

cheers
0
 
LVL 1

Expert Comment

by:alfanhendro
ID: 7124314
exactly.
(point goes to ryancys if it helps)
0
 
LVL 4

Author Comment

by:escheider
ID: 7132449
Works like a champ.  I appreciate both of your help and have awarded ryancy's the points because alfanhendro said to do so.

Thanks

Escheider
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question