filters on sub reports

battenberg

Burning candles both ends
Local time
Today, 14:39
Joined
Sep 25, 2006
Messages
118
I have a report which contains a sub report,

I think i may be doing this all wrong...

My report opens via a command button using the following code:

Code:
[ProjectRef].SetFocus
     
    Dim stDocName As String
    Dim stLinkCriteria As String
    
    stDocName = "rptPre-Com"
    stLinkCriteria = "[ProjectRef]=" & "'" & Me![ProjectRef] & "'"
    DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

I want to be able to filter the parent report and the sub Report using [ProjectRef] so that when the combination of the two reports open, both the parent form and the sub form are filtered using the same criteria.

Sureley there is a command which can be applied to the properties of the sub form,, so that it always follows the rules of the filter of it's parent... but I dont know what it is...!!!

Can anybody show me the jedi way of making this happen!

However, I may be going about this in totally the wrong way if so please advise...

Thankyou OB1
 
In the properties of the subreport control, you'll find master/child links, which can be used to keep the subreport in sync with the main report.
 
in the risk of sounding thick....

I cannot find master/child links...

Where Abouts am I looking for this?

am I building an expression in the on open command???

Thanksyou..
 
you genius!

They are hidden well..!

Thanks a million...
 
Sorry, boss asked me to do something just as I saw your first post. Glad you found them. They are a little hard to find at first.
 
I am haveing this exact same problem and it has proven to be extremely frustrating.

I have linked the subreport to the report in every way the interface allows. Using all combinations of linkage provided in the wizard interface, as well as manually linking child / master through the properties window.

Why does Access insist on making things that should be so simple agonizingly difficult?!

Every time I open the report, it asks for the OrderID two times. EVERY TIME! It works perfectly fine other than that.

I am so frikin' tired of this I'm about to start pulling out hair.
 
rick, if its asking for an orderid, when it should know what the parameter is, then you probably have a parameter in a square bracket such as [orderid]. if the punctuation/spealling etc is slightly off, access can't find the field referred to, so it asks you instead, once for the main report, and once for the subreport, using the contents of the square bracket. Is this happening?
 

Users who are viewing this thread

Back
Top Bottom