2465 Error for Subreport..? (2 Viewers)

Heatshiver

Registered User.
Local time
Today, 06:48
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?
 

Heatshiver

Registered User.
Local time
Today, 06:48
Joined
Dec 23, 2011
Messages
263
Actually may have solved this. Len doesn't seem to be working but IsNull will.
 

Heatshiver

Registered User.
Local time
Today, 06:48
Joined
Dec 23, 2011
Messages
263
IsNull works in the subreport, but still the same error if on the main. Likely an event issue.
 

JHB

Have been here a while
Local time
Today, 01:48
Joined
Jun 17, 2012
Messages
7,732
Show a printscreen of the error, or post you database with some sample data.
 

Heatshiver

Registered User.
Local time
Today, 06:48
Joined
Dec 23, 2011
Messages
263
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.
 

boblarson

Smeghead
Local time
Yesterday, 16:48
Joined
Jan 12, 2001
Messages
32,059
FYI - Subreports load first before the main report.
 

Heatshiver

Registered User.
Local time
Today, 06:48
Joined
Dec 23, 2011
Messages
263
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

Top Bottom