Filter Subform A2002

  • Thread starter Thread starter David
  • Start date Start date
D

David

I'm trying to filter a subreport by user input. The recordsource of the
subreport is a SQL statement with >=[StartDate] in the criteria, so the user
enters the StartDate. Problem is opening the Main report, user must enter
StartDate for every record in the main report recordsource. Is there a way
to filter a subreport with user input?
Thanks!
David
 
Use a form instead of a parameter.

In the Criteria row of the subreport's query, under the date field, enter
something like this:
= [Forms]![Form1]![txtStartDate]

Provided the form is open and the text box contains a valid date, the
subreport will just keep reading the date from the there.

(If you are really stuck, you can reassign the SQL property of the QueryDef
before opening the report.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

David said:
I'm trying to filter a subreport by user input. The recordsource of the
subreport is a SQL statement with >=[StartDate] in the criteria, so the user
enters the StartDate. Problem is opening the Main report, user must enter
StartDate for every record in the main report recordsource. Is there a way
to filter a subreport with user input?
Thanks!
David
 
Cool, the textbox on the form worked great! Thanks!
D

Allen Browne said:
Use a form instead of a parameter.

In the Criteria row of the subreport's query, under the date field, enter
something like this:
= [Forms]![Form1]![txtStartDate]

Provided the form is open and the text box contains a valid date, the
subreport will just keep reading the date from the there.

(If you are really stuck, you can reassign the SQL property of the QueryDef
before opening the report.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

David said:
I'm trying to filter a subreport by user input. The recordsource of the
subreport is a SQL statement with >=[StartDate] in the criteria, so the user
enters the StartDate. Problem is opening the Main report, user must enter
StartDate for every record in the main report recordsource. Is there a way
to filter a subreport with user input?
Thanks!
David
 
Back
Top