Command button problem

usr33t

Registered User.
Local time
Today, 14:41
Joined
Dec 1, 2004
Messages
21
Hi,

I have a command button on page 1 of a form, which, when pressed, I would like to move to the first field on page 2 of the form. I have achieved this to some extent using a simple macro.

However, this is what I would really like to happen;

(1) After tabbing out of the last field on the first page of the form I would like the focus to shift to the command button (but not actually 'pressing' the button).

(2) Once this has occurred, the only keys/buttons that can be used to 'press' the button are the spacebar, the enter key or a left click on the mouse. If the tab key is pressed then I want the focus to shift back to the first field of the first page.

(3) If any other key/button is pressed whilst the focus is on the command button I don't want anything to happen.

Any ideas?
Many thanks in advance.

Best regards to all.
Russell
Usr33t
 
(1) After tabbing out of the last field on the first page of the form I would like the focus to shift to the command button (but not actually 'pressing' the button).


Have you tried changing the tab order of the fields and command buttons, so that the command button is the last?

(2) Once this has occurred, the only keys/buttons that can be used to 'press' the button are the spacebar, the enter key or a left click on the mouse. If the tab key is pressed then I want the focus to shift back to the first field of the first page.

(3) If any other key/button is pressed whilst the focus is on the command button I don't want anything to happen.

I think that these should happen anyway.

Sorry if I've been competely unhelpful or get the wrong end of the stick! If I'm talking rubbish reply with more information.
 
Thanks for your reply - it's good to know that I'm not completely off the mark!

Under the event property for the button i have the following;

OnClick: nextpage (which runs a macro that goes to the first field on page 2 of the form)

If I leave it at that then I can indeed go to the first field on page 2 of the form by clicking on the button. However, if I wish tab through it (not clicking or pressing enter/spacebar), instead of the focus shifting back to the first field on page 1 (which is what I want), a new record is created.

I tried adding a macro under the OnExit event property which tells the computer to go to the first field on the first page, however this did not work, presumably because the Access does not know which macro I want to run.

Thanks again for your help
Russell
Usr33t
 

Users who are viewing this thread

Back
Top Bottom