Printing sub form filtered data

ECEK

Registered User.
Local time
Today, 19:44
Joined
Dec 19, 2012
Messages
717
My frmHolding has an unlinked sub form frmDatasheet

My rptSummary has a linked sub report rptDetails

I'm trying to open my frmHolding, filter frmDatasheet and then press a button (on frmHolding) to print rptSummary (with the linked rptDetails) based on the chosen frmDatasheet filter.

This is the long version of "I want to print a filtered form".
I hope that I've been clear enough.

Could you advise please?
 
Use the WhereCondition argument of the OpenReport method to pass the Filter property of the subform.
 
Hi there DBGuy. Could you illustrate what you mean using my example form/report names?
 
Like this:
Code:
DoCmd.OpenReport “rptSummarry”, , , Me.frmDatasheet.Form.Filter
 
Thanks DBGuy
Perfect!!

There is one little bug bare !!
When I filter my dataset and open the report everything is fine, however when I close and revisit the dataset (showing all of the data) it reverts to showing the previous filtered data.

Wondering how best to refresh the report ? Perhaps on close !! Not sure how to do this.
 
I would probably switch off the filter on form load and or set the filter to ""
 
Morning Minty
I tried that but it then doesn't filter (as per the frmDatasheet)
My button press codes to open with a filter surely "OnLoad" Filter "" will then negate this?

I was thinking that a refresh all "After" the fact would be better or open the report normally and then apply the frmDatasheet filter ?

Could I refresh the data of my subform frmDatasheet in the command of "Onclose" of the frmHolding ?
 
Fixed.
I have simply put a Filter "" on opening the frmHolding

Yay !!!!!
 
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom