Report/Form need help

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
 
D

Duane Hookom

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top