how to filter a record in subreport

  • Thread starter Thread starter Kim
  • Start date Start date
K

Kim

hi.
I have a form with three text boxs.
first text box name Staff_ID.
second text box name StartDate.
third text box name EndDate.

After click preview button in the form it will open a report.

What I need is the report which has a Staff_ID field will show the record
that is Staff_ID in the form.

And in subreport thich has a date field will show the record that is between
[StartDate] and [EndDate] in the form.

How can I write a module with filter?

Thank you.
 
Trying to apply a filter to a subreport is messy, so base the report on a
query.

In the Criteria row in query design, under the date field, enter something
like this:

Between [Forms]![Form1]![StartDate] And [Forms]![Form1]![EndDate]
 
Hi Allen,
I've tried to use the criteria in query design, it quite work well.
Thank for your help.

Allen Browne said:
Trying to apply a filter to a subreport is messy, so base the report on a
query.

In the Criteria row in query design, under the date field, enter something
like this:

Between [Forms]![Form1]![StartDate] And [Forms]![Form1]![EndDate]

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

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

Kim said:
hi.
I have a form with three text boxs.
first text box name Staff_ID.
second text box name StartDate.
third text box name EndDate.

After click preview button in the form it will open a report.

What I need is the report which has a Staff_ID field will show the record
that is Staff_ID in the form.

And in subreport thich has a date field will show the record that is
between
[StartDate] and [EndDate] in the form.

How can I write a module with filter?

Thank you.
 
Back
Top