By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,380 Members | 3,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,380 IT Pros & Developers. It's quick & easy.

Menubar access from Borderless Form using Alt+letter?

Expert 100+
P: 446
Hi
I have been writing Access applications for some years now and have moved away from from the 'Switchboard' type of opening form to using a menubar accross the top of the screen and borderless form used as a 'background', which shows a graphic, revision status & contact details etc

The menu-bar works fine when clicked by a mouse, but beeps when using an Alt+ letter 'acceleration' key, unless another user-form is already open over the top of the background.

I have tracked this down to the fact that the 'background' form does not have a control box (borderless) even though this Property is checked Yes. This begs two questions;-
1. Is this the best way to create a background?
2. Is there a programmatic solution to the issue?

I have tried writing code for the KeyDown event and can detect when the Alt key is pressed (keycode=18), then make the Background form invisible, to pass focus to a dummy form which does have a Control Box, then usually the menu action takes effect, although sometime it need two goes. Not very elegant and negates the purpose of the background form.

I'm trying to write macros initiated by the Ctrl key instead of Alt but this has it's own problems (works ok if the menu action opens a single form but beeps if the menu action is to expand a sub-group), as well as deviating from normal convention.

There must be a simple solution. Anyone know it?
Sep 11 '07 #1
Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,494
This is a very interesting question.
I'm afraid that there is not as much interest in keyboard shortcuts as you may imaging generally. Personally I like the idea and try to use them for preference, but I find I'm in the minority.
Don't expect this to be made easy for you as you're some way off the beaten track here (unfortunately).
I find typically that Alt+letter combinations depend very much on context (in as much as they depend on where the current window is (especially within an application)). If you can find the context where these shortcuts do work then you may get somewhere setting the context where it needs to be on hitting of the Alt key within your code.
I'm afraid I can be little help with this as it's not something I ever felt strongly enough about to swim through the treacle on it.
Good luck though anyway, and if you do get a decent solution then I, for one, would be interested in reading about it.
Sep 19 '07 #2

Denburt
Expert 100+
P: 1,356
If I found your solution you just might be surprised. First I am a keyboard fanatic I like my shortcut keys and I have never noticed this before especially since I have the control box set to no and a dialog for a border on my form so I played with it some and saw your complaint.

It has been quite a while since I have used custom menus so I had to put this one through the ringer when in code I counted a hit every time so I am not sure your issue there UNLESS.

O.K. drum roll :) Seriously though I found that when I had no control box and I press and hold the alt key while I press the shortcut key it did not work. Although if I pressed the alt key then released it before I hit my shortcut key it worked every time... Try this and let me know, especially since I feel pretty stupid at just realizing this, I noticed it would do this at times but never was able to check it out now I know why I was having my issue does it help yours?

I also noticed that when I press the alt key then release, it bypasses the key down event on my main form altogether. Let me know if this helps in any way and good luck sounds like you will need to add some hot key tips in there somewhere so others will know as well.
Sep 19 '07 #3

ADezii
Expert 5K+
P: 8,638
Hi
I have been writing Access applications for some years now and have moved away from from the 'Switchboard' type of opening form to using a menubar accross the top of the screen and borderless form used as a 'background', which shows a graphic, revision status & contact details etc

The menu-bar works fine when clicked by a mouse, but beeps when using an Alt+ letter 'acceleration' key, unless another user-form is already open over the top of the background.

I have tracked this down to the fact that the 'background' form does not have a control box (borderless) even though this Property is checked Yes. This begs two questions;-
1. Is this the best way to create a background?
2. Is there a programmatic solution to the issue?

I have tried writing code for the KeyDown event and can detect when the Alt key is pressed (keycode=18), then make the Background form invisible, to pass focus to a dummy form which does have a Control Box, then usually the menu action takes effect, although sometime it need two goes. Not very elegant and negates the purpose of the background form.

I'm trying to write macros initiated by the Ctrl key instead of Alt but this has it's own problems (works ok if the menu action opens a single form but beeps if the menu action is to expand a sub-group), as well as deviating from normal convention.

There must be a simple solution. Anyone know it?
Why not incorporate the graphic, revision status, contact details, etc. into a Graphic File and set the Picture Property of the Form to it?
Oct 3 '07 #4

Expert 100+
P: 446
Guys, thanks for responding. Sorry I have not been back sooner.

ADezii, I thought you were implying that there was a 'Picture' attribute that you could set to the application to avoid needing a background form but if so I still can't find it, so I am stuck with my borderless form.

Denburt, you solution really works!!! Hitting the Alt key but NOT HOLDING IT DOWN allows the next key to go to the menu; job done!
'Why' is for another day.

My trial solution of using Ctrl+ a key to initiate a DoCmd.OpenForm from a macro worked but was obviously a non-starter to sell to users. (Incidentally, DoMenuItem overcame the problem I hit, where I needed to open a sub-menu rather than a form)

However, I found that I could use the F-keys (that row at the top of the keyboard that never get used, apart from F1) to fire-off a macro. It looks a bit Retro to put F1, F2 etc in front of your menu options but is very... 'Functional'

This paid off on another project though.

As a final point on keyboard short-cuts (using the Alt key) you will know that you do not see any text on a command button (in Access) if you use a picture. As I use an arrow picture on the buttons to move between records (unbound forms) I found that by setting the Caption to &> allowed the Alt+> combination to move to the next record.

Thanks again for your help.

Thanks for your help again.
Oct 20 '07 #5

NeoPa
Expert Mod 15k+
P: 31,494
Thanks for posting back Sierra. It's always good to have the resolution posted :)
Oct 21 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.