469,568 Members | 1,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

Referencing the Caption of a Custom Popup in VB


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
2 2018
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

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.

Similar topics

4 posts views Thread by Randell D. | last post: by
3 posts views Thread by starbuck | last post: by
7 posts views Thread by Wally | last post: by
2 posts views Thread by eljainc | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.