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
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