Solved

Access - Bound Textbox Select existing info when GotFocus or DoubleClick

Posted on 2014-01-26
4
409 Views
Last Modified: 2014-01-26
Hello All.

Have a bound form.  Bound form has Bound textboxes.  If I'm going back to a prior input box I want the info in that bound textbox "selected" so that the user doesn't add info to it but overrides it.....

The bound boxes are formatted "Currency"  problem is, as you probably know, if I've input 20 for $20.00 then it only sees the Len as "2"

My code is ....

Private Sub tAmt_GotFocus()
    Me.tAmt.SelStart = 0
    Me.tAmt.SelLength = Len(Me.tAmt)

End Sub


So it only "selects" 2 characters in my bound textbox...

?????
0
Comment
Question by:wlwebb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39810636
Is this what you want?
len(format(20,"$00.00"))

Open in new window

0
 

Author Comment

by:wlwebb
ID: 39810641
No.....a GotFocus event that fires when a textbox gets the focus that selects all that boxes info regardless of what it is......
0
 
LVL 10

Accepted Solution

by:
Gozreh earned 500 total points
ID: 39810642
Add ".Text"

Private Sub tAmt_GotFocus()
    Me.tAmt.SelStart = 0
    Me.tAmt.SelLength = Len(Me.tAmt.Text)
End Sub
0
 

Author Closing Comment

by:wlwebb
ID: 39810650
Thanks "M".... Perfect
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question