F
Freddy G
I have a simple problem that is driving me crazy. All i
want to do is highlight the text in a field as a user tabs
through them in a Datasheet subform.
First let me start by saying that I'm aware that there is
a way to default it to do so under in Tools/Options -
Keyboard tab, but it has been set to "Go To Start of
Field" so that I can control when the text is highlighted
(our users had a knack for "accidently" hitting a
character and unknowingly overwriting information that was
highlighted)
Anyways, I have the following code which works fine when
using it for a Form, but when I use it for a Datasheet it
won't highlight the text:
< Private Function HighlightField(currField As TextBox)
< currField.SelStart = 0
< currField.SelLength = Len(currField)
< End Function
Each text box that I want to allow highlighting on uses
the following code in its GotFocus event:
< Private Sub txtLoanAmt_GotFocus()
< Call HighlightField(Me.txtLoanAmt)
< End Sub
Can anyone explain a fix, or another solution for
highlighting text for a Datasheet? Is there a way I could
change the Keyboard Options using code when this datasheet
is opened to "Select Entire Field" and change it back
to "Go To Start of Field" when the form closes?
Thanks in advance.
Freddy G
want to do is highlight the text in a field as a user tabs
through them in a Datasheet subform.
First let me start by saying that I'm aware that there is
a way to default it to do so under in Tools/Options -
Keyboard tab, but it has been set to "Go To Start of
Field" so that I can control when the text is highlighted
(our users had a knack for "accidently" hitting a
character and unknowingly overwriting information that was
highlighted)
Anyways, I have the following code which works fine when
using it for a Form, but when I use it for a Datasheet it
won't highlight the text:
< Private Function HighlightField(currField As TextBox)
< currField.SelStart = 0
< currField.SelLength = Len(currField)
< End Function
Each text box that I want to allow highlighting on uses
the following code in its GotFocus event:
< Private Sub txtLoanAmt_GotFocus()
< Call HighlightField(Me.txtLoanAmt)
< End Sub
Can anyone explain a fix, or another solution for
highlighting text for a Datasheet? Is there a way I could
change the Keyboard Options using code when this datasheet
is opened to "Select Entire Field" and change it back
to "Go To Start of Field" when the form closes?
Thanks in advance.
Freddy G