Solved

Access - Bound Textbox Select existing info when GotFocus or DoubleClick

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

770 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