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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Recordsource as Subform Syntax Problem

Status
Not open for further replies.

pdldavis

Technical User
Oct 29, 2001
522
US
Hi, I need to set a reports recordsource from a subform and cannot get the syntax right:

Dim frm As Form

If (CurrentProject.AllForms("frmDailyRptsPopUp.frmDailyRptsSub[/color ]").IsLoaded) Then
Set frm = ("Forms!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

The report is being printed from the subform, not the main form.

Any help would be appreciated.

Thanks

 
The report is being printed from the subform, not the main form.

What is the record source of the sub form? Why not just print the report using the same record souce as the sub form.

HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Hi, that's what I am trying to do. Thes report's recordsource is the subform <filtered> record source. I've done this several times where I'm using the main form as a recordsource, but not using a subform - hence the syntax problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top