2465 Error for Subreport..?

Heatshiver

Registered User.
Local time
Tomorrow, 01:38
Joined
Dec 23, 2011
Messages
263
I have some code in the main report's On Load event that begins with:

Code:
If Not Len(Reports![rptDRMCSCCD]![rsubPersonnel].Report.Namee1) > 0 Then
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.Namee1.Visible = False
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.ID1.Visible = False
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.Title1.Visible = False
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.Label12.Visible = False
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.Label14.Visible = False
    Reports![rptDRMCSCCD]![rsubPersonnel].Report.Label16.Visible = False
End If
Initially, I ran this in a module on the main report. When I run it I get the error. I have checked spelling for everything, but it is perfect. I also tried this code in the subreport itself as:


Code:
If Not Len(Me!Namee1) > 0 Then
    Me!Namee1.Visible = False
    Me!ID1.Visible = False
    Me!Title1.Visible = False
    Me!Label12.Visible = False
    Me!Label14.Visible = False
    Me!Label16.Visible = False
End If
While this doesn't give an error, it doesn't do anything either... Any suggestions?
 
Actually may have solved this. Len doesn't seem to be working but IsNull will.
 
IsNull works in the subreport, but still the same error if on the main. Likely an event issue.
 
Show a printscreen of the error, or post you database with some sample data.
 
Thanks for the reply.

I actually figured out a workaround. I used the subreport's Timer event to use my code with IsNull. The timer interval is set at 2.

I tried this on the main report as well (timer interval at 4), but it didn't work (no error given, just ignored).

There are a lot of subreports on the main report, so I imagine it is a timing issue, however, testing the main report makes it seem contrary.
 
FYI - Subreports load first before the main report.
 
Thanks, Bob. I had read this before, but it's good to know it's true by a pro.
 

Users who are viewing this thread

Back
Top Bottom