Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Unanswered: Select all data in a field

    Is there a way, in a form, to automatically select all the data in a control when a user clicks on the control?

    Suppose a control contains "ABCDEFG". Right now, if I click on the control, the cursor
    shows where I clicked (in between C & D), and in order I to change the data I have to manually highlight it all. I'd rather click on the control and have all the data selected.
    Inspiration Through Fermentation

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    I think it's something to the effect of

    Me.tboName.SelStart = 0
    Me.tboName.SelLength = Len(Nz(Me.tboName, ""))

    I think it's OnEnter event, but can't recall exactly off the top of my head, sorry.
    Me.Geek = True

  3. #3
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Exactly what I was looking for. Thanks
    Inspiration Through Fermentation

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You also need to place he same thing in the OnClick event of the textbox, in case they use the mouse! Doesn't seem logical, but there you are!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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