Duane,
Thanks for your reply.
1. I probably didn't write my question well. I'm don't think can use
master/child links in this instance.
2. What I really need is to add a where clause to the SQL recordsource in
the subform, e.g. WHERE ShareClass = 'A', or use a Filter.
Whether this record restriction is applied depends on the report name
chosen from a listbox.
This is an ADP running off SQLServer.
3. I tried utting Filters and ServerFilters in both the Main form OnOpen
event, Main Form Detail section, and the subform OnOpen event.
me.ServerFilter = "[ShareClass] = 'A'"
I get message: "Setting you entered isn't valid for the property."
Is there any way to change the subreport recordsource at run time?
Thanks.
Alan
Duane Hookom said:
I think this would only frustrate you. Changing the record source of a
subreport might be doable once. Can't you use the link master/child
properties rather than attempting to change the record source?
--
Duane Hookom
MS Access MVP
Hi,
I want to set, in the main report, the recordsource for a subreport.
The recordsource of the subreport will change depending on the value of
a field in the main report.
What is the VBA syntax for this?
Would it be done in the OnOpen event of the main report?
Thanks.
Alan