By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Field colors

P: n/a
Using Access 2000.
I have a form with about a dozen fields .

As each field gets or loses focus I change the background color between
white (lost focus) and yellow ( got focus).

Makes a nice effect.

I want to surpress the text highlighting that happens when a field is
selected.

Any ideas how to do this?

Dec 19 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
RICHARD BROMBERG wrote:
Using Access 2000.
I have a form with about a dozen fields .

As each field gets or loses focus I change the background color
between white (lost focus) and yellow ( got focus).

Makes a nice effect.

I want to surpress the text highlighting that happens when a field is
selected.

Any ideas how to do this?
Tools
- Options
- Keyboard
Behavior Entering Field
(o) Select Entire Field
( ) Go to Start of Field
( ) Go to End of Field

The default is "Select Entire Field". Choose either of the other two.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 19 '06 #2

P: n/a
Thanks Rick

Is it possible to code this into the Access application in stead of
selecting it fromthe toos menu ?

Dick B
"Rick Brandt" <ri*********@hotmail.comwrote in message
news:SL******************@newssvr25.news.prodigy.n et...
RICHARD BROMBERG wrote:
>Using Access 2000.
I have a form with about a dozen fields .

As each field gets or loses focus I change the background color
between white (lost focus) and yellow ( got focus).

Makes a nice effect.

I want to surpress the text highlighting that happens when a field is
selected.

Any ideas how to do this?

Tools
- Options
- Keyboard
Behavior Entering Field
(o) Select Entire Field
( ) Go to Start of Field
( ) Go to End of Field

The default is "Select Entire Field". Choose either of the other two.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Dec 19 '06 #3

P: n/a
RICHARD BROMBERG wrote:
Thanks Rick

Is it possible to code this into the Access application in stead of
selecting it fromthe toos menu ?
If you are distributing this to others I would not recommend that as it will
affect all of their Access apps, not just yours. On individual forms you
can also code this in the GotFocus Event of each control (which you are
likely already using anyway).

Just set the SelLength property of the control to zero...

Me.ControlName.SelLength = 0

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 19 '06 #4

P: n/a
or to something like

me.controlname.selLength = len(me.controlname)+1

to set the cursor at the END of the field.

Ron

Dec 19 '06 #5

P: n/a
Just answered this same question today for someone else in the "Forms"
section:

'This sets cursor at the end of current text
Private Sub YourTextBox_Enter()
Me.YourTextBox.SelStart = Len(YourTextBox.Value)
End Sub

'This sets cursor at the beginning of current text
Private Sub YourTextBox_Enter()
Me.YourTextBox.SelStart = 0
End Sub

'This selects (hi-lites) all of the current text
Private Sub YourTextBox_Enter()
Me.YourTextBox.SelStart = 0
Me.YourTextBox.SelLength = Len(YourTextBox.Value)
End Sub

--
Message posted via http://www.accessmonster.com

Dec 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.