Report/Form need help

  • Thread starter Thread starter TotallyConfused
  • Start date Start date
T

TotallyConfused

I am trying to open report and a form to enter parameters . This is what I
have - I keep getting error message. Can someone please tell me what I am
doing wrong? Thank you.

'Use this if the source is on the main form
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Forms![PCollector].Form.RecordSource

With Forms![PCollector].Form
If .OrderByOn Then
Me.OrderBy = .OrderBy
Me.OrderByOn = True
End If
If .FilterOn Then
Me.Filter = .Filter
Me.FilterOn = True
End If
End With

End Sub
 
What is the error message? What line causes the error?
Is the record source of the form actually dynamic so that the record source
of the report needs to be dynamic?
Have you tried commenting out every line setting a property and then
uncommenting them one at a time to see where the code breaks?
 
Back
Top