Excel VBA Textbox positioning cursor

  Heefie 21:46 14 Oct 2005
Locked

A quick question please. When i open a userform that contains a textbox & 2 buttons (OK & Cancel).. The OK buton is currently selected... How do I force the cursor to be in the textbox?

Cheers in advance

  Access genu 21:50 14 Oct 2005

right click on the form in design mode and select tab order, move the textbox to the top of the list

  Skills 22:13 14 Oct 2005

I think you can also use the setfocus command

eg textbox1.setfocus

which means that the focus will be set to the textbox and therefore the cursor will be placed there. Thats if i remember correctly.

  Heefie 13:11 17 Oct 2005

The first option worked perfectly, the second I haven't tried yet, but thanks for the suggestion, I'll get around to it !!!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

HP Envy x2 review: Hands-on

Iconic New York graphic designer Milton Glaser on his uplifting new subway posters

New iMac Pro release date, UK price & specs rumours

Comment suivre le parcours du père Noël ?