Access - Bound Textbox Select existing info when GotFocus or DoubleClick

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...

?????
wlwebbAsked:
Who is Participating?
 
GozrehCommented:
Add ".Text"

Private Sub tAmt_GotFocus()
    Me.tAmt.SelStart = 0
    Me.tAmt.SelLength = Len(Me.tAmt.Text)
End Sub
0
 
MacroShadowCommented:
Is this what you want?
len(format(20,"$00.00"))

Open in new window

0
 
wlwebbAuthor Commented:
No.....a GotFocus event that fires when a textbox gets the focus that selects all that boxes info regardless of what it is......
0
 
wlwebbAuthor Commented:
Thanks "M".... Perfect
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.