Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help modifying code for printing from filtered sub-form.

Status
Not open for further replies.

pdldavis

Technical User
Oct 29, 2001
522
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top