Report not executing code

  • Thread starter mr3316a via AccessMonster.com
  • Start date
M

mr3316a via AccessMonster.com

I am running Access 2007, and have the following problem.
In my report's load event, a have the following code:

If Me.Controls("txtProofReq").Value = "NO" Then
Me.Controls("lblProof").Visible = False
Me.Controls("txtProofDate").Visible = False
Me.Controls("txtProofTime").Visible = False
Else
Me.Controls("lblProof").Visible = True
Me.Controls("txtProofDate").Visible = True
Me.Controls("txtProofTime").Visible = True
End If

Its purpose is to make some controls visible or not based on the data being
presented.
When I print preview the report, it works as expected.
However, when I send the report directly to the printer without being opened
it doesn't work.

Does anyone have any suggestions on how to make it work?

Thanks in advance
Mark
 
B

Bob Howard

I'm not certain of this, but I don't think the controls have their values
during the load event. I realize there's a difference when you open in
preview mode ... and I cannot account for that. I've also had similar
issues, and I decided to move the code to the Report Header's OnFormat
event. bob
 
D

Duane Hookom

The code should be in the On Format event of the report section containing
the controls.
 
M

mr3316a via AccessMonster.com

Thanks for the help!

Duane said:
The code should be in the On Format event of the report section containing
the controls.
I am running Access 2007, and have the following problem.
In my report's load event, a have the following code:
[quoted text clipped - 21 lines]
Thanks in advance
Mark
 

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