color added after click or update

  • Thread starter Thread starter djshides
  • Start date Start date
D

djshides

I have a form that I need to add a color feature to. When the user clicks on
a part of the form to go to another form I would like to shade the selected
record to keep track of where they were when they return to that form. Can
anyone tell me the easiest way to temporaily shade records until closing out
of the form completely?
Thank you.
 
djshides said:
I have a form that I need to add a color feature to. When the user clicks on
a part of the form to go to another form I would like to shade the selected
record to keep track of where they were when they return to that form. Can
anyone tell me the easiest way to temporaily shade records until closing out
of the form completely?


Add a hidden text box named txtLineID to the form's header
section. Then add a line of code to the form's Current
event:
Me.txtLineID = Me.[the primary key field]

Now, create a text box (with no attached label) that fills
the form's detail section and use Format - Send to Back to
put it behind all the other controls. Use Format -
Conditional Formatting on this text box and set the Value Is
option to
Equal To [txtLineID]
and select your favorite highlighting color.

You will probably want to set any detail section labels'
BackStyle to Transparent.
 
By saying add the code to the form's Current even what do you mean? My code
has more than one that it could be added to.


Marshall Barton said:
djshides said:
I have a form that I need to add a color feature to. When the user clicks on
a part of the form to go to another form I would like to shade the selected
record to keep track of where they were when they return to that form. Can
anyone tell me the easiest way to temporaily shade records until closing out
of the form completely?


Add a hidden text box named txtLineID to the form's header
section. Then add a line of code to the form's Current
event:
Me.txtLineID = Me.[the primary key field]

Now, create a text box (with no attached label) that fills
the form's detail section and use Format - Send to Back to
put it behind all the other controls. Use Format -
Conditional Formatting on this text box and set the Value Is
option to
Equal To [txtLineID]
and select your favorite highlighting color.

You will probably want to set any detail section labels'
BackStyle to Transparent.
 
With the form open in design view, select the square in the
upper left part of the form where the two rulers start (a
little black box should appear in the square). Then use the
View - Properties menu item to display the property sheet.
The property sheet's title bar should say "Form"

Select the property sheet's Event tab and scan the list for
the On Current property (should be the first one) and select
[Event Procedure] in the drop down box at the right of the
property. Then click on the builder button [...] to the
right of the drop down. That should take you to the form's
Current event **procedure** where need to put the line of
VBA code.
--
Marsh
MVP [MS Access]

By saying add the code to the form's Current even what do you mean? My code
has more than one that it could be added to.


Marshall Barton said:
djshides said:
I have a form that I need to add a color feature to. When the user clicks on
a part of the form to go to another form I would like to shade the selected
record to keep track of where they were when they return to that form. Can
anyone tell me the easiest way to temporaily shade records until closing out
of the form completely?


Add a hidden text box named txtLineID to the form's header
section. Then add a line of code to the form's Current
event:
Me.txtLineID = Me.[the primary key field]

Now, create a text box (with no attached label) that fills
the form's detail section and use Format - Send to Back to
put it behind all the other controls. Use Format -
Conditional Formatting on this text box and set the Value Is
option to
Equal To [txtLineID]
and select your favorite highlighting color.

You will probably want to set any detail section labels'
BackStyle to Transparent.
 
Back
Top