Use Mailing Address

  • Thread starter Thread starter serviceenvoy
  • Start date Start date
S

serviceenvoy

I have a database of technician addresses. Sometimes their location
address is different from their mailing address. We check a box
labeled "use mailing address" and then we fill out their mailing
address. I have a report that prints their regular address but I
don't know how to make the report look at the alternate mailing
address when that checkbox is checked. Can anyone help me with this?
 
In the query that comprises the recordsource for the report, use something
like:

IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As Address
 
In the query that comprises the recordsource for the report, use something
like:

IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As Address

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)


I have a database of technician addresses. Sometimes their location
address is different from their mailing address. We check a box
labeled "use mailing address" and then we fill out their mailing
address. I have a report that prints their regular address but I
don't know how to make the report look at the alternate mailing
address when that checkbox is checked. Can anyone help me with this?

I tried to put this in the query the report is based on. I assume I
should use the same type of formula for each field like this:
IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As
Address
IIf([UseMailingCity], [MailingCity], [LocationCity]) As City
IIf([UseMailingState], [MailingState], [LocationState]) As State
etc. Is that right?
Do I put that formula in the criteria section of the query or
somewhere else?
When I put it in the criteria section I got an error on the "As
Address" section.
What do I need to do?
 
You put those formulae in empty columns on the Fields row.

However, IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As
Address is how it will appear in the SQL of the query. When you're working
with the grid, you need to put

Address: IIf([UseMailingAddress], [MailingAddress], [LocationAddress])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I tried to put this in the query the report is based on. I assume I
should use the same type of formula for each field like this:
IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As
Address
IIf([UseMailingCity], [MailingCity], [LocationCity]) As City
IIf([UseMailingState], [MailingState], [LocationState]) As State
etc. Is that right?
Do I put that formula in the criteria section of the query or
somewhere else?
When I put it in the criteria section I got an error on the "As
Address" section.
What do I need to do?
In the query that comprises the recordsource for the report, use
something
like:

IIf([UseMailingAddress], [MailingAddress], [LocationAddress]) As Address

I have a database of technician addresses. Sometimes their location
address is different from their mailing address. We check a box
labeled "use mailing address" and then we fill out their mailing
address. I have a report that prints their regular address but I
don't know how to make the report look at the alternate mailing
address when that checkbox is checked. Can anyone help me with this?
 
Back
Top