Question

  Asked: May 12 2008   5:29 PM GMT
  Asked by: Thuzinec


Combined Address


SQL, Query, Microsoft Access

I have one tblContacts that has "Home" and "Work" address included within it, I also have an option button 1="Work" and 2="Home". I need to prepare a mailling report, but only for the defaut address.
Someone suggested that I create a calculated field. I tried this but all that it is doing is pulling the HomeAddress into the column, and I need both combined. His suggestion was
Base the report on a Query with a calculated field:

UseAddress: IIF([Forms]![YourForm]![YourOptionGroup] = 1, [Workaddress],
[Homeaddress])

If - as you should! - the address consists of multiple fields (Address1,
Address2, City, State, Postcode) then you'll need to repeat this logic for
each field.
I did not quite understand him, I set up my calculated field like this:
Below is what I put in the query. He said to repeat this, does he mean I
need to write in the same calculated field the
“IIF([Forms]![frmContacts]![DefaultAddress] = 1, [WorkCity] and all this in
the same calculated field “MainAddress” query’s?
This is what I put in the query below.
This is the calculated field-“MainAddress”:
“IIF([Forms]![frmContacts]![DefaultAddress] = 1, [WorkAddress], [HomeAddress]
The fields that I am addressing, which are in the same table are:
WorkAddress, WorkCity, WorkStateOrProvince, WorkPostalCode and
HomeAddress, HomeCity, HomeStateOrProvince, HomePostalCode

Thank you!
Terra

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


Start this Answer and Earn your Knowledge Points!

By clicking "Create Answer", you can write the answer to this question that can be improved upon by your peers using the Answer Wiki.

Browse more Questions and Answers on Development and Database.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register