Solved

Creating VB Menus with code

Posted on 2002-06-30
6
142 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 51

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 51

Accepted Solution

by:
Ryan Chong earned 25 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 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