Full Version: HighLight filed on click
UtterAccess Forums > Microsoft® Access > Access Forms
CHKarcher
I want to have the entire field be selected (highlighted) when they click into the field, as if they were tabbing to it. What is the code OnFocus for this?
Thanks
steve
niesz
Conditional Formatting will do this with no code.
CHKarcher
I have the field format to fixed - but clicking on the field still does not highlight the entire field. Am I misunderstanding what you mean
teve
niesz
Yes, you've misunderstood....
pen your form in Design view
Select the control
Choose from the File Menu:
Format> Conditional Formating...
Change the value to "Field Has Focus" and select the color.
CHKarcher
I like that to - but it does not grab the entire string of data. When you tab from field to field it grabs the entire string of data - but if you click on the field it put the cursor at the point where you clcik and does not grab the entire text -
This is what i am trying to accomplish - grabbing the entire field on click
steve
niesz
Try:
CODE
Private Sub YourControl_Click()
nbsp;   With Me.YourControl
        .SelStart = 0
        .SelLength = Len(Nz(Me.Text2))
    End With
End Sub

Edited by: niesz on Mon Jul 21 13:20:19 EDT 2008.
CHKarcher
Doesn't grab the entire date on a date field
Any ideas of why
thanks
steve
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.