Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnPrint Event - Invalid Action Property 1

Status
Not open for further replies.

ccma

MIS
Oct 23, 2003
23
0
0
US
Hi~

I have a report that displays productivity figures for individual reps along with a chart. The page breaks whenever there is a new rep. At one point the department manager would have a chart that did not match the data assigned to the individual rep but would be someone elses data. When I pulled the reports on my PC all my reports would come up with no problem. To fix this I added a code on the OnPrint event of the report

On Error Resume Next
Dim objChart As Object
Set objChart = Me!Chart80
objChart.Refresh
DoEvents
Set objChart = Nothing
End Sub

Now the new problem is that another individual who has XP as her OS is receiving the following error message:

"This action can't be carried out while processing a form or report event.
A macro specified as the OnOpen, OnClose... property setting contains an invalid action for the property."

Myself and the department head do not receive this error message and our OS is Windows 98 (if that has anything to do with it).

A little info about myself I'm a VB beginner - so bare with me. Thanks for your interest. Cherly
 
First, there is no OnPrint event for a report, just in the detail, header or footer.

Inserting your code into the OnPrint Event for the detail section of the report runs fine on my XP Pro PC, and the report prints fine.

Does the boss have an older version of the db that may contain a macro in the OnOpen or OnClose event???
 
Like I said I'm a beginner --- but I am 100% sure that it is on the OnPrint event in the detail section of the report - and because that is the only macro or VB that I created on the report.

The database is on the network and is not split so everyone is working on the same database and the db was created on my PC. The department head works in a different office so I'm going by screen shots she has been sending me. There is no possible way she could be working on a seperate database.

CC
 
That's gonna be tuff to figure, becasue as I said, the code works fine on my PC.

I would comment out the On Error Resume Next, insert some error handling code, maybe something like this:

Function SampleErrorHandlingStructure()
On Error GoTo SampleErrorHandlingStructure_Err

Dim objChart As Object
Set objChart = Me!Chart80
objChart.Refresh
DoEvents
Set objChart = Nothing

SampleErrorHandlingStructure_Exit:
Exit Function

SampleErrorHandlingStructure_Err:
MsgBox Error$
Resume SampleErrorHandlingStructure_Exit

End Function

Then I would set a break point and step thru the code.




 
Gotcha

I will try this out and re-post with a result (hopefully).

Thanks for your suggestion. Cherly
 
Well it worked --- the individual did not get the previous error message -- she did receive a new error message only because she had to many applications up and there was not enough free memory- once she closed the larger apps she was able to preview the reports.

Thanks for your patience and assistance!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top