Subreport existent under creteria

G

GL

Hello

I have a report named ‘ItemsReport’ that has on it ‘Kind’ footer a subreport
named ‘ItemsSubReport’.
I want to have the subreport on the report only when a criterion is met.
The criterion is when the ‘txtBox1’ and ‘txtBox2’ and ‘txtBox3’ that are
three text boxes in the form’s header have all of them the word ‘ALL’. The
three text boxes take their values from another form’s combo boxes.
Can you please advise how can I do it?

Thank you,
GL
 
A

Allen Browne

1. If you do not already have one, create a query for the subreport.

2. Add the table that provides the subreport's data.

3. In query design view, type this into the Field row:
[Forms].[Form1].[txtBox1]
substituting your form name for Form1.

4. In the Criteria row under this field, enter:
"ALL"

5. In the next column, in the Field row, enter:
[Forms].[Form1].[txtBox2]
with the same criteria.

6. Repeat for txtBox3.

7. Save the query.

8. Open the subreport in design view, and make sure its RecordSource
property is set to the name of this query.

When the 3 text boxes all read "ALL", the query will have records, so the
subreport will too. Otherwise the query (and therefore the subreport) will
have no records.
 
G

GL

Thanks, it works fine

Allen Browne said:
1. If you do not already have one, create a query for the subreport.

2. Add the table that provides the subreport's data.

3. In query design view, type this into the Field row:
[Forms].[Form1].[txtBox1]
substituting your form name for Form1.

4. In the Criteria row under this field, enter:
"ALL"

5. In the next column, in the Field row, enter:
[Forms].[Form1].[txtBox2]
with the same criteria.

6. Repeat for txtBox3.

7. Save the query.

8. Open the subreport in design view, and make sure its RecordSource
property is set to the name of this query.

When the 3 text boxes all read "ALL", the query will have records, so the
subreport will too. Otherwise the query (and therefore the subreport) will
have no records.

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

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

GL said:
Hello

I have a report named 'ItemsReport' that has on it 'Kind' footer a
subreport
named 'ItemsSubReport'.
I want to have the subreport on the report only when a criterion is met.
The criterion is when the 'txtBox1' and 'txtBox2' and 'txtBox3' that are
three text boxes in the form's header have all of them the word 'ALL'. The
three text boxes take their values from another form's combo boxes.
Can you please advise how can I do it?

Thank you,
GL
 

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