Consulting

Results 1 to 4 of 4

Thread: vba cursor in textbox

  1. #1

    vba cursor in textbox

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    TextBox.SelStart = 3
    [/vba]

    as an example
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    i tried the SetFocus method of a textbox...that worked for me! This puts the cursor inside the textbox.

    Textbox.Setfocus
    Last edited by rrrprogramer; 07-10-2009 at 06:34 AM.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What I showed you was how to pick the offending point. You use the two in conjunction.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •