Re: Right click?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bill (stanton_at_jps.net)
Date: 02/20/05


Date: Sun, 20 Feb 2005 21:21:00 GMT

Okay, it never occurred to me about the "=" in front of the
function name. Anyway, having properly adjusted the syntax
in the OnAction property, I was able to run code in the
function.

I'm confused by some terms: What's the difference between
a "general module" and a "standard module"? The function I
successfully executed was "located" in the code*** of the
form, not coded in a "module" as one views the database
objects, e.g., Tables, Queries, Forms, Reports, Pages,
Macros and "Modules".

This latest caper has proven to be very valuable, so I'm
grateful to all those that contributed to my education on
the subject of shortcut menus.... thanks!

Bill

"PC Data***" <nospam@nospam.spam> wrote in message
news:FW6Sd.2215$Ba3.1363@newsread2.news.atl.earthlink.net...
> To start, you need to put a function or sub in a standard module for what
> you want the menu item to do. Assuming you want to open your report, put
> something like the following in a standard module:
> Sub MySubToOpenReport()
> On Error Resume Next
> DoCmd.OpenReport "MyReport", acPreview
> End Sub
>
> Now in the OnAction property you need to tell Access that when the menu
> item
> is selected, it needs to run a specific function or sub. In our case, put
> the following in the OnAction property:
> =MySubToOpenReport()
>
> Note that the equal sign is needed and also the parameter parantheses are
> needed. If you omit either, you will get an error message.
>
> --
> PC Data***
> Your Resource For Help With Access, Excel And Word Applications
> resource@pcdata***.com
> www.pcdata***.com
>
>
> "Bill" <stanton@jps.net> wrote in message
> news:xY5Sd.1652$MY6.210@newsread1.news.pas.earthlink.net...
>> In the property *** of a shortcut menu item what do
>> I set the "OnAction" to call a code*** subroutine?
>> I've tried "Call subname arg" and just "subname arg",
>> but I get diagnostics about not finding a macro or function
>> when I click on the shortcut item.
>>
>> Thanks,
>> Bill
>>
>>
>> "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
>> news:37s5mpF5hmpgpU1@individual.net...
>> > "Bill" <stanton@jps.net> wrote in message
>> > news:W35Sd.1729$873.720@newsread3.news.pas.earthlink.net...
>> >> Rick,
>> >> How do I get the menu item into the menu to begin with?
>> >> For example, I've already selected and inserted cut,
>> >> copy and paste into my new shortcut menu, but I don't
>> >> see anywhere in the "Command Tab"an option to add a
>> >> new user item.
>> >
>> >
>> > Just copy any existing item and then change the OnAction, Icon, and
> Text.
>> >
>> > --
>> > I don't check the Email account attached
>> > to this message. Send instead to...
>> > RBrandt at Hunter dot com
>> >
>>
>>
>
>


Quantcast