Microsoft
Software
Hardware
Network
Question : sub report with null fields
my report with the sub report will not print when there is nothing in the sub report
i am using a form with a print preview button - with the following code
Private Sub Print_Preview_Click()
On Error GoTo Err_Print_Preview_Click
Dim stDocName As String
stDocName = "NewGrievanceReport"
DoCmd.OpenReport "NewGrievanceReport", acPreview, , "[GrievancesTbl_new].[ID]=
" & Me.Involved_subform.Form.I
DLink
Exit_Print_Preview_Click:
Exit Sub
Err_Print_Preview_Click:
MsgBox Err.Description
Resume Exit_Print_Preview_Click
End Sub
Answer : sub report with null fields
ssblue:
I'm going to bet that the query for this report's subreport uses INNER joins or no joins at all.
This means that if there is no match between the records of the main report and the sub report that you WILL NOT GET a return of records.
Change the query of the subreport to include the main table from the main report. Use Master/Child linking to have the subreport associate UPWARD to the main report on the key fields.
What you want to happen is that in EVERY report you want a record (even if there are alot of null values) to populate the subreport. You can do this by having part of the main table act as that record. Using LEFT JOINS from Main table to sub table you create a condition where the main supplies the key fields for the subreport record, EVEN IF NO RECORD EXISTS IN THE SUB TABLE.
does this make sense to you?
-j-
Random Solutions
printing a file given the path in windows API
Basic steps for a Zip code search ASP.NET VB, MS SQL 2008
Calendar question
Pass Web Page as Parameter to Class in App_Code Folder
video card driver
How to restrict on categories with recurrent items using VBA in access
active directory, W2k8 R2 DC, Kerberos failures, Event ID: 3, 4771, 4769, 4768, 4776, 4625 source: Microsoft Windows security
Access attaching a file as xls when it should be rtf
insert image via bookmark
Same form on different computers