Setting colors for text fields (need help)

  • Thread starter Thread starter J Nachbar
  • Start date Start date
J

J Nachbar

I'm trying to set background / foreground colors on text fields in a report
(Access2000).

I'm preparing a Module SUB called "SetTabColor" to set the colors by using
Case statements, since "conditional formatting" isn't flexible enough (I
need to specify colors based on a linked table field).

I don't know how to trigger the SUB to run. Where does the call to
":SetTabColor" go?

Thanks

Jim
 
J said:
I'm trying to set background / foreground colors on text fields in a report
(Access2000).

I'm preparing a Module SUB called "SetTabColor" to set the colors by using
Case statements, since "conditional formatting" isn't flexible enough (I
need to specify colors based on a linked table field).

I don't know how to trigger the SUB to run. Where does the call to
":SetTabColor" go?


Generally, you would use the Format event of the section
containing the controls you want to manipulate.
 
Sorry, but I'm still confused.

All these text fields appear in the "Detail" section. If I display the
properties in "Section:Detail", I see the "On Format" event, but don't know
how to call the SUB called SetTabColor. Do I run a Macro that calls the
SUB? Is there a preferred method?

Unfortunately, I am not experienced with these programming issues.

Thanks for your help

Jim
 
J said:
Sorry, but I'm still confused.

All these text fields appear in the "Detail" section. If I display the
properties in "Section:Detail", I see the "On Format" event, but don't know
how to call the SUB called SetTabColor.

The detail section's OnFormat property should contain
[Event Procedure]
This indicates that the event procedure named Detail_Format
will be called at the appropriate time.

Most of what you need to do is nearly automatic. Click on
the detail separator bar or a blank area within the detail
section, then locate the OnFormat property in the property
sheet. When you click on the little button with ... way
over in the right margin, Access will set the property,
create a skeletal event procedure and place you in the VBE
ready to add your code. This is where you put the line of
code that calls SetTabColor.
--
Marsh
MVP [MS Access]


 
Back
Top