Help!

Report not executing code

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Reports RSS
Next:  graduation announcement cards  
Author Message
mr3316a via AccessMonster
External


Since: May 18, 2010
Posts: 2



PostPosted: Tue May 18, 2010 6:10 pm    Post subject: Report not executing code
Archived from groups: microsoft>public>access>reports (more info?)


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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201005/1
Back to top
Bob Howard
External


Since: Jul 30, 2007
Posts: 5



PostPosted: Tue May 18, 2010 6:10 pm    Post subject: Re: Report not executing code [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"mr3316a via AccessMonster.com" wrote in message

>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
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201005/1
>
Back to top
Duane Hookom
External


Since: Jan 17, 2010
Posts: 33



PostPosted: Tue May 18, 2010 10:23 pm    Post subject: Re: Report not executing code [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

--
Duane Hookom
MS Access MVP


"mr3316a via AccessMonster.com" wrote in message

> 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
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201005/1
>
Back to top
mr3316a via AccessMonster
External


Since: May 18, 2010
Posts: 2



PostPosted: Wed May 19, 2010 8:10 am    Post subject: Re: Report not executing code [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the help!

Duane Hookom wrote:
>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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201005/1
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Reports All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum