Enter your email address:

Delivered by FeedBurner



Use your pdf converter to make your pdf files easy! You can now buy software that makes converting pdf to doc possible! Did you know you can even convert pdf to word?
Home Page

Bloglines

1906
CelebrateStadium
2006


OfficeZealot

Scobleizer

TechRepublic

AskWoody

SpyJournal












Subscribe here
Add to 

My Yahoo!
This page is powered by Blogger. Isn't yours?

Host your Web site with PureHost!


eXTReMe Tracker
  Web http://www.klippert.com



  Sunday, September 27, 2015 – Permalink –

Text Box Highlights

Change background


It can be difficult to tell which text box on a form you're currently working with.

One solution is to highlight the current position, with a different background.

Access 2000+ allows you to do this with conditional formatting, but you can also get a similar result using code.
To do so, create a new Module and add the following code:


Function Highlight(Stat As String) As Integer
Dim ctrl As Control
On Error Resume Next
Set ctrl = Screen.ActiveControl
If Stat = "GotFocus" Then
     ctrl.BackColor = 65535
ElseIf Stat = "LostFocus" Then
     ctrl.BackColor = 16777215
End If
End Function



Save and close the Module, then open the appropriate Form in Design view.
Click the Code button and insert =Highlight("GotFocus") in each of the Form's textbox control's GotFocus event procedure.
Likewise, add =Highlight("LostFocus)") to each textbox's LostFocus event procedure.

When you've finished, save the changes, close the VBE, and switch to Form view.



When you tab to a field, it's shaded yellow. When you tab away from the field, its background is restored to white.

Also:

Allen Browne:
Field highlighting solutions


See all Topics

Labels: , , , , , , ,


<Doug Klippert@ 3:42 AM

Comments: Post a Comment