Although you can set the RecordSource of a report in its Open event, I don't
think that will work for a subreport.
Can you use the LinkMasterFields/LinkChildFields to limit the subreport?
Can you set up the subreport's query to read the criteria from a form?
The other alternative is to write the SQL property of the QueryDef that the
subreport is based on before opening it, e.g.:
dbEngine(0)(0).QueryDefs("Query1").SQL = "SELECT ...
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Hank" <ha********@aol.comwrote in message
news:11**********************@l70g2000cwa.googlegr oups.com...
I'm using Access 2000 and want to set up the dataset for a subreport.
I trying to use the Forms!SubForms scenario as a guide but I cannot get
it. Here is my try:
Reports![Lights]![Light List].Report.Recordsource = SQL Statement
Also Tried:
Me![Light List].RecordSource = SQL Statement
My syntax is not right. Can anyone help?
Thanks,
Hank Reed