Substituting fields on a report

William Carl

New member
Local time
Today, 13:41
Joined
Dec 28, 2001
Messages
5
On my report there are certain times when I want to print a mailing address instead of a home address. I want to use the same area on the report to print either of these addresses. I'm not quite sure how to go about this.

Thanks ---
 
Here are a couple of ideas:

If the query or table that is supplying the report only ever returns either a mailing address or a home address but not both, then superimpose two (sets of) text boxes (one sourced by the home address, one by the mailing address) on the same part of the report. Set the background to be transparent and you'll see either one or the other on the report.

Another alternative would be to use the IIf function. In the text box for the first address line, set the control source to something like:

=IIf([UseHomeAddress]=True,[HomeAddrLine1],[MailingAddrLine1])

and so on for each control that holds the address. If you always show the mailing address when there is one, you could change that to something like

=IIf(IsNull(MailingAddrLine1]),[HomeAddrLine1],[MailingAddrLine1])

If the report is based on a query, you could accomplish this in the query rather than in the report.

Simon.
 

Users who are viewing this thread

Back
Top Bottom