navigate commands within a form

D

DKeith

I am trying to adapt Access 2000 (on XP) for my disabled child. I have a
form with several command buttons and one of them (for instance, the correct
answer to a math question) sends him to another form.

My problem is in getting past the "correct answer" *without* triggering the
OpenForm command. If I use a key event for the second switch (with which he
makes his choice), even the tab key sends him on to the
next form. Makes him a winner every time, but I want him to have to choose
the right answer.

Is there a way to (A.) specify a particular key down rather than all of
them? I'm thinking of something like If tab, Then [next command], Else Open
Form. But I"m too dim to know what to Dim. Or, (B.) a way to have the
pointer go where the focus is so I could use a click event? Or, (C.) a
better way altogether?
 
J

John Vinson

I am trying to adapt Access 2000 (on XP) for my disabled child. I have a
form with several command buttons and one of them (for instance, the correct
answer to a math question) sends him to another form.

My problem is in getting past the "correct answer" *without* triggering the
OpenForm command. If I use a key event for the second switch (with which he
makes his choice), even the tab key sends him on to the
next form. Makes him a winner every time, but I want him to have to choose
the right answer.

Is there a way to (A.) specify a particular key down rather than all of
them? I'm thinking of something like If tab, Then [next command], Else Open
Form. But I"m too dim to know what to Dim. Or, (B.) a way to have the
pointer go where the focus is so I could use a click event? Or, (C.) a
better way altogether?

One thing which might help is to set the form's Cycle property to
"Current Record"; tabbing will go through the form controls in their
tab order, then back to the first one. Hitting the spacebar when a
button is selected will click it.

I'm not certain what is triggering the OpenForm command. You say "key
event for the second switch" - I'm not sure what that means! If what
I'm suggesting isn't working, please post back, with more detail about
the code that you're using.

John W. Vinson[MVP]
 
D

DKeith

John,
You solved it. I thought I had to move the pointer to the command button
with the focus in order to use the "click event" property to run the macro to
open a sub form. Since I didn't know using the spacebar would "click" an
active object, I was trying to run the Openform macro with a "keydown"
property of the active object.

I'm learning.
Thanks for your help; this could be *very* helpful for my son.
David

John Vinson said:
I am trying to adapt Access 2000 (on XP) for my disabled child. I have a
form with several command buttons and one of them (for instance, the correct
answer to a math question) sends him to another form.

My problem is in getting past the "correct answer" *without* triggering the
OpenForm command. If I use a key event for the second switch (with which he
makes his choice), even the tab key sends him on to the
next form. Makes him a winner every time, but I want him to have to choose
the right answer.

Is there a way to (A.) specify a particular key down rather than all of
them? I'm thinking of something like If tab, Then [next command], Else Open
Form. But I"m too dim to know what to Dim. Or, (B.) a way to have the
pointer go where the focus is so I could use a click event? Or, (C.) a
better way altogether?

One thing which might help is to set the form's Cycle property to
"Current Record"; tabbing will go through the form controls in their
tab order, then back to the first one. Hitting the spacebar when a
button is selected will click it.

I'm not certain what is triggering the OpenForm command. You say "key
event for the second switch" - I'm not sure what that means! If what
I'm suggesting isn't working, please post back, with more detail about
the code that you're using.

John W. Vinson[MVP]
 
J

John Vinson

Thanks for your help; this could be *very* helpful for my son.

Delighted to be of assistance! Give him a hug (or, if he'd prefer, a
high-five) from me.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top