thuzinec
Technical User
- May 12, 2008
- 6
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
I would very much appreicate any help!
Thanks,
Terra
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
I would very much appreicate any help!
Thanks,
Terra