PDA

View Full Version : vba cursor in textbox



rrrprogramer
07-10-2009, 06:00 AM
Is there a way to put a cursor in a textbox in VBA??
i'm checking for blank data or invalid data in textbox. I would like to put a cursor in the textbox, so the user will know where the problem is.

Bob Phillips
07-10-2009, 06:06 AM
TextBox.SelStart = 3


as an example

rrrprogramer
07-10-2009, 06:18 AM
i tried the SetFocus method of a textbox...that worked for me! This puts the cursor inside the textbox.

Textbox.Setfocus

Bob Phillips
07-10-2009, 06:41 AM
What I showed you was how to pick the offending point. You use the two in conjunction.