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

Click on Command Button how do I get it to go to a field on the form

Status
Not open for further replies.

torf66

Programmer
Jun 10, 2003
43
US
I have a command button 'Add Record'. When I click on it I need to have the cursor or pointer go to the strAdmitNumber field on the form. How can this be done?
Thanks,
Todd
ttorfin@dakcl.com
 
Hi torf66

Include something like this in the button's
Code:
OnClick
event.

Code:
Me.Controls("YourControlName").SetFocus

That should do the trick!

Regards

Mac
 
use the setfocus method of whatever control you wish to give focus.

Somewhere in the cmd_AddRecord_OnClick event add the following line of code.

Me.strAdmitNumber.SetFocus

Assuming of course that your textbox is named strAdmitNumber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top