![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have a database with a form that displays records in continuous form view. I would like to change the colour of the line of text when a record is selected Phil |
#3
| |||
| |||
|
|
You can try the following: Add an unbound control to your form header ==Control Name: txtCurrentRecord ==Visible: No (unless you want to show the value for some reason) Add another unbound control to your form in the detail section ==Control Name: txtHighlight ==Visible: Yes ==Back Style: Normal ==Back Color: -2147483643 (or whatever color you are using for the form section) ==Special Effect: Flat ==Border Style: Transparent ==Size the control so it is the size of the row Select txtHighlight and then select Conditional Formatting ==Set Condition 1 to Expression is: [txtCurrentRecord] = [PrimaryKeyField] ==Select the Back Color you want to use as a highlight ==Click OK button Now, send the control txtHighlight to the back so it is behind all your other controls (Menu: Format: Send to Back Select all the other controls on the row and set their Back Style to Transparent You don't need to change the Border Style In the Form's current Event add a line of code Private Sub Form_Current() Me.txtCurrentRecord = Me!PrimaryKeyField End Sub John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 2/17/2011 11:33 AM, Phil Rushton wrote: Hi I have a database with a form that displays records in continuous form view. I would like to change the colour of the line of text when a record is selected Phil |
#4
| |||
| |||
|
|
Brilliant Thank you so much. This has been driving me crazy. Phil "John Spencer"<JSPENCER (AT) Hilltop (DOT) umbc> wrote in message news:ijjn9g$30n$1 (AT) news (DOT) eternal-september.org... You can try the following: Add an unbound control to your form header ==Control Name: txtCurrentRecord ==Visible: No (unless you want to show the value for some reason) Add another unbound control to your form in the detail section ==Control Name: txtHighlight ==Visible: Yes ==Back Style: Normal ==Back Color: -2147483643 (or whatever color you are using for the form section) ==Special Effect: Flat ==Border Style: Transparent ==Size the control so it is the size of the row Select txtHighlight and then select Conditional Formatting ==Set Condition 1 to Expression is: [txtCurrentRecord] = [PrimaryKeyField] ==Select the Back Color you want to use as a highlight ==Click OK button Now, send the control txtHighlight to the back so it is behind all your other controls (Menu: Format: Send to Back Select all the other controls on the row and set their Back Style to Transparent You don't need to change the Border Style In the Form's current Event add a line of code Private Sub Form_Current() Me.txtCurrentRecord = Me!PrimaryKeyField End Sub John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 2/17/2011 11:33 AM, Phil Rushton wrote: Hi I have a database with a form that displays records in continuous form view. I would like to change the colour of the line of text when a record is selected Phil |
![]() |
| Thread Tools | |
| Display Modes | |
| |