Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shortcut key 2

Status
Not open for further replies.

nkamp

Programmer
Jan 19, 2004
35
0
0
NL
Hello,

I'm new to MSAccess. I have to maintain an access application.
Can somebody explain to me how to define a shortcut key like ALT+P. When I press these key combination I want to open a form (popup), without closing the "parent" form.

In the existing application they define already the key combination ALT+U but can't find it where they did it or how they did it.

Can somebody help me?

Thanks in advance.

Nico
 
Look for a macro named AutoKeys. That is where you define shortcut keys.

Paul
 
Hello Paul,

Where can I find this? In the database objects macro I have found only two macro's:
- mcrCleanupTempTables action setwarnings and RunSQL tblTempApplicants
- mcrDelivery with action SetWarnings and RunSQL as wel statements.

But I can't find any Autokeys macro like here while there already some shortkeys exist!

But where can I find/define the macro Autokey?


Nico
 
Note that creating an AutoKeys macro, brilliant though it is for creating keyboard shortcuts, does not allow for ALT + whatever, only plain keys, SHIFT+, CTRL+ and SHIFT+CTRL+ (at least up to A2002 anyway). Since the original poster was wanting to shortcut ALT+U this may be a problem.

Paul is right, AutoKeys is the only place within native Access to define shortcut keys. Just search Access Help for 'Autokeys' and you'll find all the help you'll need. The link Paul supplied also has good advice thereon.
 
If you really wanted to trap Alt+? keystrokes you could use a call the Win32 API to hook the keyboard, but this isn't something I'd recommend for a beginner...

Ed Metcalfe.

Please do not feed the trolls.....
 
But thats strange. The Access application which I'm working on, has at least two shortcuts ALT+U en ALT+D. Both are opening a form and are working correct. No problem at all.

But under the object macro there is not a Autokeys macro!!! Or where must I look for the autokey macro????

Or must I add a reference or add a Add-in for this specific subject. But why should I? The shortcuts are working.

It seems so simple to me but its making me crazy!!

Nico
 
Another way of setting keyboard shortcuts is behind the on Key Down, Key Up, Key Press events of a form.

Are you sure the macro isn't just hidden?

Ed Metcalfe.

Please do not feed the trolls.....
 
You could try looking for some code or a macro that uses the SendKeys function. It is not the preferred way to create shortcut keys, but it does work. If you find it, you might just incorporate all the actions into one AutoKeys macro.
Also, you might see if there are any hidden objects in the database. On the menu bar go to Tools....Options and on the View tab make sure the Show Hidden Objects checkbox is checked.


Paul
 
Hello Paul,

The hidden objects and system objects checkbox where not checked. But when I made thes boxes checked, I see now some system query.

I don't if it made a slight different if I say I'm looking for a key combination ALT+p. I read something that in my autokeys you can only define for example ^p CTRL+P or %{F10} F10, but no alt keys.

is it made in the menubar?

Nico
 
You don't need to show the System Objects. There isn't anything in there you are going to want to deal with so I would uncheck that box. I don't know of any way to search the other objects to look for key combinations.
I don't think you can define the Alt key for SendKeys actions. The Alt key is used by Microsoft for Menu shortcuts but I'll have another look at it.


Paul
 
Another way of setting keyboard shortcuts is behind the on Key Down, Key Up, Key Press events of a form.

did you check the Key Down/Up/Press events of the form that the Alt shortcuts work from?



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
The <ALT> + <any key> is reserved by Access for shortcuts you assign to command buttons by placing the ampersand in front of a letter on the button's caption; this is why the <ALT> key is not available in the AutoKeys macro. Assumming you have no command button already on your form that uses the P as a shortcut key, do the following:

Place a command button on your form

Place the code to open your popup form behind this button

In the properties box for this button enter &Popup for the Caption

Under Properties > Format change Transparent to YES

Now pressing <ALT> + <P> should open your popup form




The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Hello Paul and Missingling,

Missingling you're right. That's what they did. On every form they put a button.

Thank you all for helping me.

Nico
 
missinglinq,

Aha! I'd forgotten about that feature of MS Access. Have a star for reminding me. :)

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top