[AccessD] Sub report filter

Stuart McLachlan stuart at lexacorp.com.pg
Tue Jan 13 15:52:03 CST 2015


The way I usually do this is with a Static Function.

In a VBA module put the following code:

Static Function dType(Optional s as string = "") as string
	DIm Store as string
	If s > "" then Store = s
	dType = s
End Function

In the query of the subreport, set DocType = dType()

Before your code to open the report insert the line :
dType filter-Info

(Note: docType rather than Type as per your subsequent post)

-- 
Stuart


On 13 Jan 2015 at 11:14, Gordon Stubbs wrote:

> Hello everyone,
> 
> It's been quite a while since I have asked a question of the group. I
> have a report with a sub-report with a field "Type". I also have a
> form with a field "filter-Info". I would like to filter the sub-report
> field "Type" based on the field "filter-Info". How do I get the sub
> report to do that. I've tried may ideas and haven't got it to work.
> 
> If I modify the query type field criteria to match the "filter-Info"
> info it will filter correctly. How can I modify the query criteria
> using VBA?
> 
> 
> Thank you.
> 
> Gordon
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list