Connecting Tech Pros Worldwide Forums | Help | Site Map

Referencing the Caption of a Custom Popup in VB

Sean Mullaly
Guest
 
Posts: n/a
#1: Nov 13 '05

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!

'69 Camaro
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Referencing the Caption of a Custom Popup in VB


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.mullaly@opg.com> wrote in message
news:41260002$0$14449$c397aba@news.newsgroups.ws.. .[color=blue]
>
> 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![/color]


Sean Mullaly
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Referencing the Caption of a Custom Popup in VB



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!
Closed Thread