Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to highlight current Record or Field 1

Status
Not open for further replies.

simpsondm

IS-IT--Management
Jan 14, 2003
21
US
New to access - Could someone please answer this, I have a number of forms both standard form/field and some forms that have sub form with dataview of records.

How can I highlight the fields in forms or records in dataview when they have focus/active
 
This is a common complaint with continuous forms in Access97. In short you cannot highlight a single text box or a even all the text boxes in a row. If you try to conditionally format a field then all the text boxes in that column will adopt that format because in fact you only have one textbox in each column. Access just clones themn in each row.

I understand that Access2K allows conditional formatting which I guess would solve the problem. As for formatting in Datasheet view I don't think its possible to do much formatting other than globally set the row height, column width, background colour and foreground colour.

The only way to control the appearance of individual fields in the seklected row is to create a form with a grid of unbound textboxes and fill them using a Dlookup function with an offset for the second and subsequent rows. Complicated but it does work.

Rod
 
1 Make a new Module

Option Compare Database

Option Explicit

Global Const White = 16777215

Global Const LightBLue = 16776960

2 Private Sub CITY_GotFocus()
City.BackColor = LightBLue

End Sub

3 Private Sub City_LostFocus()
City.BackColor = White
End Sub

The module tells Access White = 16777215

LightBlue= 16776960

This example says Access when I enter the CITY field turn LightBlue And WHITE when I leave.Just saw the last post Thought I used this in 97 it was so long ago though.

Pbk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top