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

Jumping straight to a particular text box

Status
Not open for further replies.

cpc34

Technical User
Aug 16, 2005
22
GB
On opening a form, I would like the cursor to be in the "Name" text box. Is there some code I can put into an Open event to do this?

Also, is there a way of automatically placing some text in that same text box? I have a main form that opens an "Add user" form if the name that is put into the main form does not exist. I would like to transfer the name that has just been typed into this "Add User" form, so that you don't have to type every name twice.

Hope this makes some kind of sense. Thanks.
 
Play with the SetFocus method in the Load event procedure of the form.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Try making the text box's tab index value = 0. Pass the name as OpenArgs and populate the text box in the Load or Open event.


Randy
 
I agree with PHV's suggestion as the best approach. If you simply wanted the focus to be on a certain field when the form opens, you *normally* can set the 'Tab Index' for that control to 0.

"Have a great day today and a better day tomorrow!
 
Randy, in the Open event controls are not yet loaded ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top