A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report not executing code



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2010, 10:07 PM posted to microsoft.public.access.reports
mr3316a via AccessMonster.com
external usenet poster
 
Posts: 4
Default Report not executing code

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/For...ports/201005/1

Ads
  #2  
Old May 18th, 2010, 10:51 PM posted to microsoft.public.access.reports
Bob Howard
external usenet poster
 
Posts: 71
Default Report not executing code

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" [email protected] wrote in message
news:[email protected]
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/For...ports/201005/1



  #3  
Old May 19th, 2010, 04:23 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Report not executing code

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" [email protected] wrote in message
news:[email protected]
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/For...ports/201005/1

  #4  
Old May 19th, 2010, 12:34 PM posted to microsoft.public.access.reports
mr3316a via AccessMonster.com
external usenet poster
 
Posts: 4
Default Report not executing code

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/For...ports/201005/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 OfficeFrustration.
The comments are property of their posters.