By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

Referencing the Caption of a Custom Popup in VB

P: n/a

I have a custom Access menu with sub-menus and sub-sub-menus. (220
items). Right now I have created 220 Functions and attached each
individual Function to the specific OnAction property. The Functions
return Text which is the same as the Caption of the sub-sub-menu items.
I would like to reference the Custom Popup Caption of these
sub-sub-menus and pass it through one Function for input in a form.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi, Sean.

220 custom functions are a *lot* of functions to maintain. Are you using
user-defined functions or Macros to automate this custom menu? Macros are
often used in creating custom menus, but Macros don't allow for error
handling. User-defined functions not only allow for error handling, but can
help streamline similar functionalities into a smaller total number of
functions, making the application easier to maintain.

You may be interested in the step-by-step tutorial on adding a custom button
to the menu bar, which includes a sample database that contains source code
for user-defined functions. Please see the "How to add a custom button on
the command bar to run code on a form" tutorial on this Web page:

http://www.Access.QBuilt.com/html/fo...l#CustomCmdBar

There's also an example of the source code needed to reference menu items
and sub-menu items on this Web page:

http://www.Access.QBuilt.com/html/vb...SetMacroSecLvl

You'll need to set a Reference to the Microsoft Office library for your
version of Office in order to use the CommandBar code.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Any human can read my reply E-mail address and should alter it so that
a message will be forwarded to me. Spammers who use my UNALTERED
reply E-mail address will only satisfy the SpamEater's hunger.)
"Sean Mullaly" <s.*******@opg.com> wrote in message
news:41**********************@news.newsgroups.ws.. .

I have a custom Access menu with sub-menus and sub-sub-menus. (220
items). Right now I have created 220 Functions and attached each
individual Function to the specific OnAction property. The Functions
return Text which is the same as the Caption of the sub-sub-menu items.
I would like to reference the Custom Popup Caption of these
sub-sub-menus and pass it through one Function for input in a form.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2

P: n/a

I'm using the menu as a data source for input on a form.
eg:
Public Function CF_001()
On Error GoTo Menu_Err
Screen.ActiveForm.Form![Casual Factors] = "Consequences of potential
error not discussed before starting work"
Menu_Exit:
Exit Function
Menu_Err:
Resume Menu_Exit
End Function
The menu item with the OnAction function CF_001() has a caption that is
identical to the value I am passing to the bound box (Casual Factors) on
the active form. If I could reference the menu item caption, then I
could pass the value of that string through one gobal function for input
into my active form.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.