There is a textbox that uses iif(sub.report.hasdata,sub.report.value,0) expression in the main report (main) to retrieve calculated field data in the subreport (sub). The sub has another 4 subreport. When in report/print view, #error shows in the main textbox. In layout view, when the sub is selected, the correct value shows up in the main textbox.
The sub when open on its own works just fine.
I suspect the sub is taking too long to load but the main textbox loads faster and is unable to retrieve data from the sub textbox.
Things tried:
-under properties tab in the sub, in timeinterval field 0 was changed to 1000 but the main textbox value show 0 which is wrong.
-removing expression from main report textbox, under properties, on load event, add in code expression
Private Sub Report_Load()
If Me.sub.Report.HasData Then
Me.main textbox.Value = Me.sub.Report!sub textbox
Else Me.main textbox.Value = 0
End If
End Sub
>> result show 0
how to get main textbox to show the correct value and print/save without selecting sub in layout view?
The sub when open on its own works just fine.
I suspect the sub is taking too long to load but the main textbox loads faster and is unable to retrieve data from the sub textbox.
Things tried:
-under properties tab in the sub, in timeinterval field 0 was changed to 1000 but the main textbox value show 0 which is wrong.
-removing expression from main report textbox, under properties, on load event, add in code expression
Private Sub Report_Load()
If Me.sub.Report.HasData Then
Me.main textbox.Value = Me.sub.Report!sub textbox
Else Me.main textbox.Value = 0
End If
End Sub
>> result show 0
how to get main textbox to show the correct value and print/save without selecting sub in layout view?