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 only current rec line in a Continuous form 3

Status
Not open for further replies.

steve728

Programmer
Mar 16, 2003
536
US
Does anyone know how to highlight only the current record fields in a continuous form? I tried the following in one of the fields "Got Focus" events:

Me.AFBALANCE.BackColor = vbBlue
Me.CODE.BackColor = vbBlue

This hightlights every record's fields instead of jus the current one. Perhaps a third party program.

I use MS Access 2002.

Thanks in advance.

Steve728
 
OK, I have had the same problem on the project I am working on... I want to change the background color for a control on a continuous form BUT if one value fales with in my condition (pass/Fail) then they all get the formatting...

Here is what I found in same sample code...

I set the combo box to transparent background. I placed a text box sized exactly the same Behind the combo box. with its background color the color as the rest of my controls on the form.

so for your need try to make a box the size of your subform.

Important stuff!!!

The format(I remember this was critical as noted in the sample I saw) of the text box is ;"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ"
Font is Terminal
Font size(you may have to change this) 12
Text box fore color (for red) 255
Control source will be your identifier of when the color will change..... for mine I use =[Result]>1 so If the field result is >1 then I want to use fore color (red is my choice) otherwise back color.

you will have to figure out your control source maybe have a hidden textbox on the form that gets a value during the get focus and changes during the lost focus event...


--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
If you're after only the current control, use conditional formatting from the format menu. In the dropdown, select "Field has focus", format...

To get the whole row, try the following:

Create an unbound text control on the form (header), call it for instance txtTest. In the on current event of the form, assign a unique value of the form to the text control (primary key, let's say txtID). Then, select all controls, enter conditional formatting, in the first dropdown, select "Expression is", then enter the expression [txtID]=[txtTest], chose some format and...

Roy-Vidar
 
I always forget about the conditional formatting!

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
How are ya steve728 . . . . .

A reference:

Highlighting data for impact on a form in Access

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top