Report on Frormat event error

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
 
D

Douglas J. Steele

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.
 
G

Guest

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
 

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