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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mimmick in VB Code on a Form?

Status
Not open for further replies.

jdegeorge

Programmer
Mar 19, 2002
1,313
US
Hi

I have a form that has some code that runs in the AfterInsert property. Because this code updates some hidden fields on the form as the last event before adding a record, I want to keep the user from having to tab to the next record twice.

Is there any VB code that will mimmick the [TAB] key? Thanks!

Jim DeGeorge [wavey]
 
hey,

just use the setfocus property once the operation is performed...

Private Sub Your_Procedure()

Do all Your Stuff Here

Text1.setfocus

End Sub

Hope this helps

Sam
 
I use SetFocus to get the hidden fields and the code updates that field. If you recall the keystrokes in adding a record during input, when you press the [TAB] key after entering information in the last field on the form, a new blank record is displayed.

Maybe I don't want to mimmick the [TAB] key. Maybe I want to commit this record and display a new blank record? If so, how would I do that in code?

Jim DeGeorge [wavey]
 
I decided to use [tt]SendKeys "{TAB}", False[/tt]. It worked great. Thanks for your help anyway!

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top