473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Shortcut menu action syntax

I have set up shortcut menus on many form successfully.

However, for the first time, I am trying to set one up on a subform.
In the 'On Action:' when customising the menu item I have:
=Forms![OrderDetails].showAvailability()

showAvailability is a public function in the module of the form
OrderDetails. This follows the working pattern for all other forms.

When I right click the item in the shortcut menu, I get the error:
"The object you referenced in the Visual Basic procedure as an OLE
object isn't an OLE object."

In this case OrderDetails is a subform of the form "Orders".

I note that if I open the Form OrderDetails on its own (as an
experiment) the right click works but not when it is opened as a
subform.

Should I amend the action to reflect this and if so, how?


Jul 31 '08 #1
2 2034
Build a public function in the "main" (parent) form.
Public Function ShowAvailability

me.orderDetails.Form.ShowAvailability()

end if

Now, in the on-action for your menu bar, go:

=ShowAvailability()
Don't include the forms qualifier for a menu, else it will run 3
times...(long time bug in access).

Remember, the form that has the focus is which form the public function will
run. So, to run code in sub-forms you best build a function in the parent
form that simple calls the sub-form code...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Jul 31 '08 #2
On Jul 31, 9:08*pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
Build a public function in the "main" (parent) form.

Public Function ShowAvailability

* *me.orderDetails.Form.ShowAvailability()

end if

Now, in the on-action for your menu bar, go:

=ShowAvailability()

Don't include the forms qualifier for a menu, else it will run 3
times...(long time bug in access).

Remember, the form that has the focus is which form the public function will
run. So, to run code in sub-forms you best build a function in the parent
form that simple calls the sub-form code...

--
Albert D. Kallal * *(Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKal...@msn.com
Thanks. After much experimentation I had just worked out how to do it
via the main form. Glad to know that that is the recommended (only?)
way.

I had not realised about leaving out the forms qualifier in the menu.
I had overcome the error by suitable code in the form's error event.
Leaving out the qualifier makes it simpler to write.

Jim

Jul 31 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Benjamin | last post by:
I have a very strange problem. I have developed a .NET solution. To set up user clients I have also included a "Deployment Project" in the solution: Using "File System Editor | User's Program...
4
by: Salad | last post by:
A97. If you set a forms properties to ShortcutMenu = No, the entire form is disabled from displaying a shortcut menu. If you set the property to Yes, all controls have a shortcut menu. I have...
2
by: JMCN | last post by:
hi i'm having a problem with the customize a shortcut menu. i read the ms office assistance: customize a shortcut menu/delete a command or add to a shortcut menu and followed the simple...
5
by: Steven | last post by:
I have some text boxes on a form in MS Access 2000. When I right click in them I don't get any shortcut menu at all. I want the normal cut, copy, and past menu to come up. In the "Startup", I...
0
by: cefrancke | last post by:
I recently discovered, that if you set the startup options for "security", you will have alot of work do to get Access back to "normal". If you disable the built-in menus/toolbars you'll have to...
4
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
2
by: ApexData | last post by:
Hi I am using the Shortcut Menu Bar property of a control to specify a Custom popupmenu that displays when the right-click of the mouse is used. Can I place some kind of command in this...
0
by: Jim Devenish | last post by:
I have successfully added shortcut menus to Forms but I am now having difficulty when I attach a shortcut menu to a text control. I have a shortcut menu entitled 'CalendarEntries' with one command...
3
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.