On further testing of Accelerator I have a problem.
I use a label to name an optbutton rather than its caption. When I set an
accelerator on the optbutton the function works fine. If I set an
accelerator on the label it does not, yet according to
VB Help: 'If the
accelerator applies to a Label, the control following the Label in the tab
order, rather than the Label itself, receives the focus.'
Any further suggestions other than use the optbutton caption?
Geoff
"Geoff" wrote:
Jim
Thanks for the reply.
That works fine in this layout. I have a number of frames to test but up to
now it has performed as needed. Because of the number of buttons and
similarity of captions i guess i will have to be inventive with the key
letter.
Accelerator plus spacebar plus tab order should give me plenty options
(sorry - couldn't resist that) to play with.
Thanks to all for their contribution.
Geoff
"Jim Cone" wrote:
Geoff,
Do you have an accelerator key set on the option button?
Enter a character from the button caption in the "Accelerator"
property in the VBE.
Then use Alt + (that character) to activate the button.
Regards,
Jim Cone
San Francisco, USA
"Geoff" wrote in message ...
Spacebar works fine when focus is on a frame which has an Exit event with
Cancel = True clause. Thank you:):)
But in another part of the form I have 4 pairs of txtboxes, each pair
representing hours and minutes. After a correct entry, I move the focus by
SetFocus from one txtbox to the next. The first 3 pairs are summed after
entering minutes in the 3rd pair(box 6) and the total is shown in pair 4.
To assist data entry in the 3rd pair I have an optionbutton which reveals a
'totaliser' for that pair only. Using the mouse I can click for this
function before data is entered into the 3rd pair or just enter directly.
Here is the problem with the Spacebar solution.
Despite using tabstop=true and tab order etc I cannot navigate to this
option button to use the Spacebar, I assume because of the coded tabbing to
the 4th pair of boxes. Does this make sense?
I wondered if i should be using Application.OnKey somehow?
Geoff
"Anne Troy" wrote:
Spacebar, Geoff. :)
*******************
~Anne Troy
www.OfficeArticles.com
"Geoff" wrote in message
...
Hi
Say for example there are 2 form optbuttons in a frame; is it possible to
tab to the required option and 'click' the button using the Enter key? If
so
how?
My form has a number of optionbuttons amongst textboxes and it is becoming
tedious to keep reaching for the mouse to make a choice or confirm
something.
It would be great to just use the keyboard as far as possible.
T.I.A
Geoff