Form Movement

  • Thread starter Thread starter Sondra
  • Start date Start date
S

Sondra

I have a form that requires one field to be entered before
proceeding. I have sent an if isnull code which requires
that field to be completed. However, I need help moving
from the field. If the user hits the tab or enter key
after entering data into the field the bounce to page 2 of
the form which is empty. I want them to bounce to the
command button located in the footer of the form. Can
someone tell me how to get there???
 
Type this code on the "ON EXIT" event of the field.

DoCmd.GoToControl "YourCommandButton"

Hope this helps.
 
Ashby:

Thanks for the help. However I already have an event in
the "ON EXIT" field. Can I add another????
 
The tab order was my originally thought; however when I go
to set my tab order, one of the fields is in the detail
portion of the form and the location I want them to go is
in the footer of the form. So the Tab Order doesn't work
for me.

I tried writing another "ON Exit" code; however it just
keeps popping me out. Not sure how to correct this.
 
Sondra said:
The tab order was my originally thought; however when I go
to set my tab order, one of the fields is in the detail
portion of the form and the location I want them to go is
in the footer of the form. So the Tab Order doesn't work
for me.

A common work-around for this is to place a tiny (but visible) control on the form
and place it in the TabOrder after your field. Then use its GotFocus event to set
focus to the button.
I tried writing another "ON Exit" code; however it just
keeps popping me out. Not sure how to correct this.

Again, you cannot have 2 OnExit events for the same control. If you already have an
OnExit event procedure, then go to that existing procedure and add more lines of code
to it.
 
Back
Top