So I have a report that i want to auto output for all FIDs with the date attached in a PDF and I can get the main report to cycle through the FIDs. However I have subreport linked through FIDs to the main report which does not get the linked FID so my subreport ends up being 200 pages of data.
My code for the output is:
My code for the output is:
Code:
Private Sub Command115_Click()
Dim MyRs As DAO.Recordset
Dim strPathAndFile As String, strDate As String
Dim strFamilyName As String
strDate = Format(Date, "ddmmyyyy")
Set MyRs = CurrentDb.OpenRecordset("FIDq")
With MyRs
.MoveFirst
Do While Not .EOF
strFamilyName = !FamilyName
strPathAndFile = "L:\Lab_NickH\Seb\Database Work\Family Reports\" & strFamilyName & " " & strDate & ".pdf"
DoCmd.OutputTo acOutputReport, "Family Report Output", acFormatPDF, strPathAndFile
.MoveNext
Loop
End With
Set MyRs = Nothing
End Sub