Solved

Access - Bound Textbox Select existing info when GotFocus or DoubleClick

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SPROC to look for existing record in passed table name 7 49
data analyst 3 50
Create Form using Wizard 14 36
access 7 26
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now