Re: Excluding Report Sections



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" <Zachry1@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0E6380CB-CD25-4579-91B9-5C4B5D5AFF0B@xxxxxxxxxxxxxxxx
> 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.


.



Relevant Pages