Hi, I have some code I found from Fancy Prairie that allowed one to print a report from a filtered form. It worked well.
I am trying to do the same from a filtered sub-form and am having some trouble with the syntax - probably in referencing the sub-form:
Dim frm As Form
If (CurrentProject.AllForms("frmDailyRptsPopUp!frmDailyRptsSub"
.IsLoaded) Then
Set frm = frmDailyRptsPopUp!frmDailyRptsSub
Me.RecordSource = frm.RecordSource
If (frm.FilterOn) Then
Me.Filter = frm.Filter
Me.FilterOn = True
End If
If (frm.OrderByOn) Then
Me.OrderBy = frm.OrderBy
Me.OrderByOn = True
End If
End If
End Sub
frmDailyRptsPopUp - the main form
frmDailyRptsSub - the sub-form
The error message says the object is closed or could not be found.
Any help would be appreciated.
Thanks
I am trying to do the same from a filtered sub-form and am having some trouble with the syntax - probably in referencing the sub-form:
Dim frm As Form
If (CurrentProject.AllForms("frmDailyRptsPopUp!frmDailyRptsSub"
Set frm = frmDailyRptsPopUp!frmDailyRptsSub
Me.RecordSource = frm.RecordSource
If (frm.FilterOn) Then
Me.Filter = frm.Filter
Me.FilterOn = True
End If
If (frm.OrderByOn) Then
Me.OrderBy = frm.OrderBy
Me.OrderByOn = True
End If
End If
End Sub
frmDailyRptsPopUp - the main form
frmDailyRptsSub - the sub-form
The error message says the object is closed or could not be found.
Any help would be appreciated.
Thanks