I have a main report that show project details, grouped by Company and Location. Location is a text value that can be blank (empty string) if the company does not have multiple locations (and sometimes for the main location of a company that does.)
I have a subreport that needs to display, and I have linked it to the master using Company and Location. This works fine if Location is filled in, but if it is an empty string that subreport is blank. How can I get these to display? Since you can join tables on an empty string I assumed you could link reports that way as well.
I also tried this code in the onFormat event of the main report's detail section as a work around:
but I get error 2101: The setting you entered isn't valid for this property when I set the filter.
Any suggestions as to how I can link the subreport with the main report? There's a fair amount of existing code that is expecting a blank string, so I'd prefer not to change how the data is represented, but I can if need be.
I have a subreport that needs to display, and I have linked it to the master using Company and Location. This works fine if Location is filled in, but if it is an empty string that subreport is blank. How can I get these to display? Since you can join tables on an empty string I assumed you could link reports that way as well.
I also tried this code in the onFormat event of the main report's detail section as a work around:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Location= "" Then
subClasses.Report.Filter = "Location = ''"
subClasses.Report.FilterOn = True
Else
subClasses.Report.Filter = ""
subClasses.Report.FilterOn = False
End If
End Sub
Any suggestions as to how I can link the subreport with the main report? There's a fair amount of existing code that is expecting a blank string, so I'd prefer not to change how the data is represented, but I can if need be.
Comment