A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report/Form need help



 
 
Thread Tools Display Modes
  #1  
Old January 11th, 2008, 08:48 AM posted to microsoft.public.access.reports
totallyconfused
external usenet poster
 
Posts: 304
Default Report/Form need help

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

  #2  
Old January 11th, 2008, 03:24 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report/Form need help

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?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


"TotallyConfused" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.