ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text box on userform (https://www.excelbanter.com/excel-programming/287082-text-box-userform.html)

pcrobinson

Text box on userform
 
Hi
having loaded a userform I want to enter data in the first text box
without having to click in it with the mouse first. The tab order is correct
and I have tried the command "textbox1.setfocus"
in the userform initialization code but this does not work and I still have
to click the mouse in the text box before entering.
Thanks for any help
Peter



Bob Phillips[_6_]

Text box on userform
 
Peter,

Is this happening the first time you call up the form, or on subsequent
calls to the form,? If the latter, you might want to try the
UserForm_Actgivate event.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pcrobinson" wrote in message
...
Hi
having loaded a userform I want to enter data in the first text box
without having to click in it with the mouse first. The tab order is

correct
and I have tried the command "textbox1.setfocus"
in the userform initialization code but this does not work and I still

have
to click the mouse in the text box before entering.
Thanks for any help
Peter





John Tjia

Text box on userform
 
Did you put this in the Userform_Initialize? Try changing the name of
the subroutine to Userform_Activate.

"pcrobinson" wrote in message ...
Hi
having loaded a userform I want to enter data in the first text box
without having to click in it with the mouse first. The tab order is correct
and I have tried the command "textbox1.setfocus"
in the userform initialization code but this does not work and I still have
to click the mouse in the text box before entering.
Thanks for any help
Peter


pcrobinson

Text box on userform
 
Spot on! Thanks
Bob Phillips wrote in message
...
Peter,

Is this happening the first time you call up the form, or on subsequent
calls to the form,? If the latter, you might want to try the
UserForm_Actgivate event.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pcrobinson" wrote in message
...
Hi
having loaded a userform I want to enter data in the first text box
without having to click in it with the mouse first. The tab order is

correct
and I have tried the command "textbox1.setfocus"
in the userform initialization code but this does not work and I still

have
to click the mouse in the text box before entering.
Thanks for any help
Peter








All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com