#error in form field returning report value

patheo

Registered User.
Local time
Today, 05:45
Joined
Dec 12, 2011
Messages
15
Hi all!

I have a form that returns a value from a report with the following formula =Reports!CA_PB!Text64
In my report, I have the following formula =IIf(Report.HasData;Sum(([INDEX_fin]-[INDEX_DEP]-[RC])*[POD_TTC]);0) to avoid error in my form when the related query has no data.
My problem is that when the report's field value is "0", my form returns #error

Please, could you help me please?
 
you can use Tempvars as your controlsource instead of =Reports!CA_PB!Text64:

=Tempvars("varReportCA_PB")

somewhere in your report set the value of tempvars, maybe on Load Event:

Privatate sub report_load()
Tempvars("varReportCA_PB")=Me.Text64
 
Hi arnelgp,

I have a compile error on Privatate sub report_open() : sub or function not defined
 
Privatate sub report_load()
Tempvars("varReportCA_PB")=Me.Text64
End Sub

this one should be put on your reports Load event.
 
You've spelled the keyword Private wrong.
Privatate sub report_load()
Tempvars("varReportCA_PB")=Me.Text64
End Sub

this one should be put on your reports Load event.
 
Hi arnelgp,

This is what I have on Open in my report but still not working, I've the same error.

Private Sub Report_Open(Cancel As Integer)
Tempvars("varReportCA_PB") = Me.Text64
End Sub

thanx fir your help
 
its in the Report Load event. On the Open event of the report, all controls don't have any values yet.
 
I don't have the on load event in my report properties. I'm using access 2000.
 

Users who are viewing this thread

Back
Top Bottom