Text Box selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has a command button for New. When I need to enter a new
record I punch the New button and expect it to default to the first text box
on the form which is the first item listed in the tab order. When I select
the New button the "Bold" option on my tool bar is selected. After I hit the
tab key once I end up at the first text box on my form where I want to be. I
have relocated the New button to be the last item on the tab order. I have
set all other buttons to: Stop = No, Enabled = Yes. The New button is
command79, where the code is: DoCmd.GotoRecord , , acNewRec. What could be
happening? When I first open the form I always get focus on the first text
box in the tab order, but when I hit New I am one tab away from the correct
text box. Any ideas on how to correct this?
 
Set the tab stop of the first text box to yes, and the tab index to 0. That
will automatically reset all other tab index numbers.

HTH
 
I already have the tab stop of the first text box set to yes and the index is
set to 0.
I just checked it. When I have the form open in edit mode and then hit the
New button I still see the "Bold" option get selected on my tool bar. If I
then hit the tab key once I arrive at the first text box on my tab order
list. I really want to arrive at the first text box immediately after I hit
the New button. Any other ideas?
 
I just discovered another thing - I had the "New" key font set to Bold. I
guess when I hit the key it, of course, would show the "Bold" option selected
on the tool bar. I set the font to normal and now "Bold" is no longer showing
as being on, but I am still not arriving at the the first text box in one
click.
 
Bobk said:
I have a form that has a command button for New. When I need to enter a new
record I punch the New button and expect it to default to the first text box
on the form which is the first item listed in the tab order. When I select
the New button the "Bold" option on my tool bar is selected. After I hit the
tab key once I end up at the first text box on my form where I want to be. I
have relocated the New button to be the last item on the tab order. I have
set all other buttons to: Stop = No, Enabled = Yes. The New button is
command79, where the code is: DoCmd.GotoRecord , , acNewRec. What could be
happening? When I first open the form I always get focus on the first text
box in the tab order, but when I hit New I am one tab away from the correct
text box. Any ideas on how to correct this?


Access does not change the focus just because you navigate
from one record to another (even a new record). Since
clicking on a button sets the focus to the button, that's
where it will be when you arrive at the new record unless
you do something to change the focus to where you want it.
Add the line:
Me.nameoffirsttextbox.SetFocus
to the button's Click event.
 
Thank You!
It works great.

Marshall Barton said:
Access does not change the focus just because you navigate
from one record to another (even a new record). Since
clicking on a button sets the focus to the button, that's
where it will be when you arrive at the new record unless
you do something to change the focus to where you want it.
Add the line:
Me.nameoffirsttextbox.SetFocus
to the button's Click event.
 

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

Back
Top