473,405 Members | 2,415 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,405 software developers and data experts.

custom shortcut menus

I want to make a custom menu so when you click it it will run code that
I've written.. only I don't know how to get the menu to run code I
want, and I know nothing of modules... can anyone explain to me how I
could achieve this? Thanks in advance

Nov 13 '05 #1
9 1622
Beacher wrote:
I want to make a custom menu so when you click it it will run code
that I've written.. only I don't know how to get the menu to run code
I want, and I know nothing of modules... can anyone explain to me how
I could achieve this? Thanks in advance


You need to make your code a function rather than a sub-routine and then
just put the name of the function into the action property for the menu.

=FunctionName()

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Thanks alot :D got it working now, your the best!

Nov 13 '05 #3
Though how do I refer to controls and forms from a module...when i
right click on a controls i need it to delete something from a
listbox.. so i need to refer to my listbox in my module

Nov 13 '05 #4
Beacher wrote:
Though how do I refer to controls and forms from a module...when i
right click on a controls i need it to delete something from a
listbox.. so i need to refer to my listbox in my module


Try...

Screen.ActiveControl

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #5
Try:

Forms!frmName!Mylistbox

So if you have a listbox on a form called frmMyForm with a listbox
called lstbxCustomers, you would use:

Forms!frmMyForm!lstbxCustomers

Nov 13 '05 #6
Like I said never done anything with modules lack of intellisense :(
lol.. anyways I referred to it Forms!formname.control.property and it
works

Thanks again for the help

Nov 13 '05 #7
Hmm I've encountered another problem.. It's telling me object is
required when I use the module to run this code, but if i put the EXACT
same code in my main form it works fine

msgbox (Forms!form1!lstCond.ItemData(lstCond.ListIndex + 1))

just msgbox(forms!form1!lstcond.listindex) works but not the above
method.

Nov 13 '05 #8
*smacks self* I see the problem gotta reference lstcond.listindex as
forms!form1!lstcond.listindex

Nov 13 '05 #9
Actually, if you put the function in the code of the form itself, then
when you select that menu item Access will FIRST check to see if the
function exists in the code module of the active form, and if it
doesn't it will look in any modules for that function. This is nice
because it provides a way for you to sort of "override" the default
functionality of a menu item for a specific form if you want, but still
have the menu item behave a certain way in all other situations. It
also allows you to easily reference the controls on the form.

Nov 13 '05 #10

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

Similar topics

10
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
3
by: Terry Bell | last post by:
I have some code that adds entries to the "Module Compiled" popup menu. Works fine in A97. You can open a module, right click, and the new entries are there for you to click. I converted it to...
2
by: phhatwork | last post by:
Hi all, I'm trying to replace the default shortcutmenus that you get when you right-click a form in datasheet view. By default you get different menus for when you click a column (you can hide and...
4
by: Karl Irvin | last post by:
I distribute an A 2000 app as a mde. On a few customers, my custom menus are overwritten. The top menu is generally there but the choices on the menus are gone or replaced by something else. ...
7
by: Ian Hinson | last post by:
I have an Access app that has been distributed with run-time installation to many different customers over many years. It is developed in Access 2000. The custom menu bar has had no problems in...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
10
by: Michael Maes | last post by:
Hi, I want to have a Button.Click event 'raise' a shortcut. If eg Button1 is Clicked, I want to have a shortcut 'CTRL + F12' activated. What's the best way to acchieve this. TIA, Michael
2
by: Keith Hutchison | last post by:
G'day Is it possible to do custom context sensitive menus within MS Access. If yes, does anyone have a sample example? Thanks in advance Keith
0
by: ARC | last post by:
Hello all, For right-click (shortcut) menus in access 2007, I've been using a round-about method of opening access 97 on an old computer, modifying my own custom shortcut menus, then importing...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.