Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return to First Tab Field

Status
Not open for further replies.

ESTAGroup

Technical User
Aug 12, 2004
53
US
I am using a form to enter new records into a table. When I press ENTER, it writes the data to the table but does not leave my cursor at the start of the tab order. How do I make it do this?

Thanks.

Gregg
 
I tried that and it is telling me that the macro does not exist. I must be missing something.
 
I'd add the code to the command button that saves the data... after saving it.. just add a the line to set the focus back to the first textbox (i.e. Textbox name is txt1...)

txt1.SetFocus


It sounds like you might be trying to add it as an action to occur by placing that code in the textbox next to the Event.. when you should be selecting [Event Procedure] in that textbox, and then place the code in the Form's module

Private Sub Form_AfterUpdate()
txt1.SetFocus
End Sub

PaulF

 
How are ya surferboy30 . . . . .

[blue]FancyPrairie[/blue] gave an excellent fix for your problem, however, it appears [blue]you may have put it in the wrong place[/blue], particularly in accordance with your return post.

So . . . in form design view, call up the properties for the form. [purple]Remove whats ever in the After Update event.[/purple] Make sure the cursor is on the event line and click the three elipses just to the right. You are now in the VBE editor an this is where the line given by [blue]FancyPrairie[/blue] goes. When you get finish,it should look like this:
Code:
[blue]Private Sub Form_AfterUpdate()
   Me![purple][b]YourFirstFieldName[/b][/purple].SetFocus
End Sub[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top