Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 19th, 2006, 04:15 PM
RICHARD BROMBERG
Guest
 
Posts: n/a
Default Field colors

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?



  #2  
Old December 19th, 2006, 04:55 PM
Rick Brandt
Guest
 
Posts: n/a
Default Re: Field colors

RICHARD BROMBERG wrote:
Quote:
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


  #3  
Old December 19th, 2006, 06:35 PM
RICHARD BROMBERG
Guest
 
Posts: n/a
Default Re: Field colors

Thanks Rick

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

Dick B
"Rick Brandt" <rickbrandt2@hotmail.comwrote in message
news:SLUhh.24128$wc5.9785@newssvr25.news.prodigy.n et...
Quote:
RICHARD BROMBERG wrote:
Quote:
>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
>
>

  #4  
Old December 19th, 2006, 06:45 PM
Rick Brandt
Guest
 
Posts: n/a
Default Re: Field colors

RICHARD BROMBERG wrote:
Quote:
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


  #5  
Old December 19th, 2006, 07:15 PM
Ron2006
Guest
 
Posts: n/a
Default Re: Field colors

or to something like

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

to set the cursor at the END of the field.

Ron

  #6  
Old December 19th, 2006, 09:35 PM
missinglinq via AccessMonster.com
Guest
 
Posts: n/a
Default Re: Field colors

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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles