Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    Covington, LA
    Posts
    46

    Question Unanswered: cursor position in a textbox

    hi everyone. i have a text box that fills with 13 alpha/numeric characters on the gotfocus command. the input mask that the text box uses must have 16 characters. when it gets focus and fills out, it selects what it just filled in, but what i'd like it to do is place the cursor at the end of the 13 characters so i can enter the last 3 and tab off it. i'm not sure where to look for a way to do this. i have scoured ms access's help file. any help or hints would greatly be apreciated! thank you all!
    Unique like everyone else,
    Clark
    -------------------------------------------
    POSTING IS THE TERRIBLE SECRET OF SPACE!

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Check the help for the SelStart and SelLength properties.

    You should be able to set the selection start (SelStart) property of that text box to 14 and the selection length (SelLength) to 3.

  3. #3
    Join Date
    Mar 2002
    Location
    Covington, LA
    Posts
    46

    Thumbs up i had just got it!

    i had went back and looked at selstart a little harder and it hit me, this is the code i use to auto fill the first 13 characters and wait for manual input of the last 3.

    Private Sub InvoiceNumber_GotFocus()
    [InvoiceNumber] = [SiteID] + Format([Date], "mmddyyyy")
    Me![InvoiceNumber].SelStart = Me![InvoiceNumber].SelLength - 3
    End Sub

    thanks!
    Unique like everyone else,
    Clark
    -------------------------------------------
    POSTING IS THE TERRIBLE SECRET OF SPACE!

Posting Permissions

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