Solved

Access - Bound Textbox Select existing info when GotFocus or DoubleClick

Posted on 2014-01-26
4
410 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

632 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