Trying to format fields in report based on their values - HELP

G

Guest

I am getting this error message when I try to run my report.

"The Expression On Format you entered as the event property setting produced
the following error: The object doesn't contain the Automation Object
"Canbdidate".

I have this expression attached to the "On Format" event in the Detail
Section of my report.

=If(Candidate!City Like
'*Potomac*',Candidate!City.BackColor=12632256,Candidate!City.BackColor=16777215)

I'm trying to get the field "City" in my report of candidates by City to
showup in different colors depending on the value of City.......

HELP!!!!
 
F

fredg

I am getting this error message when I try to run my report.

"The Expression On Format you entered as the event property setting produced
the following error: The object doesn't contain the Automation Object
"Canbdidate".

I have this expression attached to the "On Format" event in the Detail
Section of my report.

=If(Candidate!City Like
'*Potomac*',Candidate!City.BackColor=12632256,Candidate!City.BackColor=16777215)

I'm trying to get the field "City" in my report of candidates by City to
showup in different colors depending on the value of City.......

HELP!!!!

I assume "Candidate" is the name of the table and "City" is the name
of the field, and that [City] is included in the report's record
source.

If Me![City] Like "*Potomac*" Then
Me![City].BackColor = 12632256
Else
Me![City].BackColor = 16777215
End If

The above will change the backcolor if the word Potomac is found
anywhere within the city name.
Make sure the control's BackStyle property is set to Normal.
 
M

Marshall Barton

Kathleen said:
I am getting this error message when I try to run my report.

"The Expression On Format you entered as the event property setting produced
the following error: The object doesn't contain the Automation Object
"Canbdidate".

I have this expression attached to the "On Format" event in the Detail
Section of my report.

=If(Candidate!City Like
'*Potomac*',Candidate!City.BackColor=12632256,Candidate!City.BackColor=16777215)

I'm trying to get the field "City" in my report of candidates by City to
showup in different colors depending on the value of City.......


You can not use VBA sstatements in the middle of a text box
expression and you can not use an expression in the OnFormat
property (which should normally be set to [Event
Procedure]).

If you select [Event Procedure] from the choices for the
OnFormat property and then click on the builder button [...]
in the property's right margin, Access will take you to the
Format event procedure where you can enter the code:

If Candidate!City Like '*Potomac*' Then
Candidate!City.BackColor=12632256
Else
Candidate!City.BackColor=16777215
End If
 
G

Guest

WORKED LIKE A CHARM - thank you SOOO much.

This discussion board has been invaluable.

Kathleen



Marshall Barton said:
Kathleen said:
I am getting this error message when I try to run my report.

"The Expression On Format you entered as the event property setting produced
the following error: The object doesn't contain the Automation Object
"Canbdidate".

I have this expression attached to the "On Format" event in the Detail
Section of my report.

=If(Candidate!City Like
'*Potomac*',Candidate!City.BackColor=12632256,Candidate!City.BackColor=16777215)

I'm trying to get the field "City" in my report of candidates by City to
showup in different colors depending on the value of City.......


You can not use VBA sstatements in the middle of a text box
expression and you can not use an expression in the OnFormat
property (which should normally be set to [Event
Procedure]).

If you select [Event Procedure] from the choices for the
OnFormat property and then click on the builder button [...]
in the property's right margin, Access will take you to the
Format event procedure where you can enter the code:

If Candidate!City Like '*Potomac*' Then
Candidate!City.BackColor=12632256
Else
Candidate!City.BackColor=16777215
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top