Report on Frormat event error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everybody,

I am trying to change the format of a text box under a certain condition.

for the detail portion of the report, in event on format I have the following:

If Me.[Asset_class] = "Total Traditional" then me.[Asset_class].BackColor =
12632256 Else me.[asset._class].BackColor = 16777215 End If

when I run the report, I get the following error
Micrsoft Access can't find the macro "If me"

Any suggestions?

Jones
 
When you say that you have that "in event on format", are you saying that
you typed that code into the box in the Properties sheet for the report?

That's VBA code. You have to select [Event Procedure] in that box, and click
on the ellipsis (...) to the right. That will take you into the VB Editor,
inside the Report_Format sub. Type the code there, and you should be okay.
 
Spot on. Thank you.

Jones

Douglas J. Steele said:
When you say that you have that "in event on format", are you saying that
you typed that code into the box in the Properties sheet for the report?

That's VBA code. You have to select [Event Procedure] in that box, and click
on the ellipsis (...) to the right. That will take you into the VB Editor,
inside the Report_Format sub. Type the code there, and you should be okay.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jones Barton said:
Hi everybody,

I am trying to change the format of a text box under a certain condition.

for the detail portion of the report, in event on format I have the
following:

If Me.[Asset_class] = "Total Traditional" then me.[Asset_class].BackColor
=
12632256 Else me.[asset._class].BackColor = 16777215 End If

when I run the report, I get the following error
Micrsoft Access can't find the macro "If me"

Any suggestions?

Jones
 
Back
Top