how to filter a record in subreport

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.
 
A

Allen Browne

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]
 
K

Kim

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top