Excluding Report Sections

G

Guest

Hello,
Working on a contract generating program. I have a table of contents listing
many articles (1-20) and attachments (A-M).
On some contracts all articles apply, on others i need to select which will
apply.
I use Text boxes in the report so I can have the article text and include
another field, such as effective _date, for example.

The problem i want to solve is:
1. How do i allow the user to select in the report which sections to exclude.
2. If a section is excluded, I need to replace its title in the table of
contents to RESERVED
3. Then the article section within the contract replace the standard wording
with the word RESERVED.
 
G

George Nicholson

This is just a general idea and is fairly short on specifics, but maybe it
will give you some conceptual ideas that you can execute:

If you have anything like a "Table of Contents" table that lists your
Section/Attachment options, you could add a T/F field called "Print?" to
that (and if you don't have such a table, maybe you should?).

Then, you'll need some sort of interface that would:
- Set Print? to True for all sections, etc. upon opening (I assume this
would be the default)
- Allow the user to de-select items as they wish, which would set Print?
to False.
- (Open the report?)

In the query that your report is based on, add the Print? field.
You'd then need to add code to your report that would react appropriately to
the value of Print? for each section/attachment, etc. Hard to say exactly
where this code would go without more specifics, but it'll probably be the
Format event of Header section(s) and/or the Detail section. Ex:
If Me.[Print?] = False Then
Me.txtTitleTextBox = "RESERVED"
Else
Me.txtTitleTextBox = rs!Title
End If

Alternatively (and much easier if it works for your report setup), you may
be able to do most of what you need in the report query, without adding code
to the report. For instance, If you have a field in your query called Title
that you want to change if Print? = False:
Title: IIf([Print?], SourceTable.Title,"RESERVED")
That way the proper value would, for each record, automatically go into any
text box on your report that already uses Title as the ControlSource.

HTH,
 
G

Guest

Thanks George, you've given me some good ideas. Let's see of i can make it
work...

George Nicholson said:
This is just a general idea and is fairly short on specifics, but maybe it
will give you some conceptual ideas that you can execute:

If you have anything like a "Table of Contents" table that lists your
Section/Attachment options, you could add a T/F field called "Print?" to
that (and if you don't have such a table, maybe you should?).

Then, you'll need some sort of interface that would:
- Set Print? to True for all sections, etc. upon opening (I assume this
would be the default)
- Allow the user to de-select items as they wish, which would set Print?
to False.
- (Open the report?)

In the query that your report is based on, add the Print? field.
You'd then need to add code to your report that would react appropriately to
the value of Print? for each section/attachment, etc. Hard to say exactly
where this code would go without more specifics, but it'll probably be the
Format event of Header section(s) and/or the Detail section. Ex:
If Me.[Print?] = False Then
Me.txtTitleTextBox = "RESERVED"
Else
Me.txtTitleTextBox = rs!Title
End If

Alternatively (and much easier if it works for your report setup), you may
be able to do most of what you need in the report query, without adding code
to the report. For instance, If you have a field in your query called Title
that you want to change if Print? = False:
Title: IIf([Print?], SourceTable.Title,"RESERVED")
That way the proper value would, for each record, automatically go into any
text box on your report that already uses Title as the ControlSource.

HTH,
--
George Nicholson

Remove 'Junk' from return address.


Zachry1 said:
Hello,
Working on a contract generating program. I have a table of contents
listing
many articles (1-20) and attachments (A-M).
On some contracts all articles apply, on others i need to select which
will
apply.
I use Text boxes in the report so I can have the article text and include
another field, such as effective _date, for example.

The problem i want to solve is:
1. How do i allow the user to select in the report which sections to
exclude.
2. If a section is excluded, I need to replace its title in the table of
contents to RESERVED
3. Then the article section within the contract replace the standard
wording
with the word RESERVED.
 
G

Guest

George, one more question.

i am using a memo field and i would like to inset several variables within
the text inside the memo field so it reads correctly, for ex:
"This work will execute" [start_date] "and is to be completed not later
than" [120 days] "or i will sue you for" [200,000] "dollars"

So i want to insert the content of several variables within a memo field.

George Nicholson said:
This is just a general idea and is fairly short on specifics, but maybe it
will give you some conceptual ideas that you can execute:

If you have anything like a "Table of Contents" table that lists your
Section/Attachment options, you could add a T/F field called "Print?" to
that (and if you don't have such a table, maybe you should?).

Then, you'll need some sort of interface that would:
- Set Print? to True for all sections, etc. upon opening (I assume this
would be the default)
- Allow the user to de-select items as they wish, which would set Print?
to False.
- (Open the report?)

In the query that your report is based on, add the Print? field.
You'd then need to add code to your report that would react appropriately to
the value of Print? for each section/attachment, etc. Hard to say exactly
where this code would go without more specifics, but it'll probably be the
Format event of Header section(s) and/or the Detail section. Ex:
If Me.[Print?] = False Then
Me.txtTitleTextBox = "RESERVED"
Else
Me.txtTitleTextBox = rs!Title
End If

Alternatively (and much easier if it works for your report setup), you may
be able to do most of what you need in the report query, without adding code
to the report. For instance, If you have a field in your query called Title
that you want to change if Print? = False:
Title: IIf([Print?], SourceTable.Title,"RESERVED")
That way the proper value would, for each record, automatically go into any
text box on your report that already uses Title as the ControlSource.

HTH,
--
George Nicholson

Remove 'Junk' from return address.


Zachry1 said:
Hello,
Working on a contract generating program. I have a table of contents
listing
many articles (1-20) and attachments (A-M).
On some contracts all articles apply, on others i need to select which
will
apply.
I use Text boxes in the report so I can have the article text and include
another field, such as effective _date, for example.

The problem i want to solve is:
1. How do i allow the user to select in the report which sections to
exclude.
2. If a section is excluded, I need to replace its title in the table of
contents to RESERVED
3. Then the article section within the contract replace the standard
wording
with the word RESERVED.
 

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