Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting particular fields for printing 1

Status
Not open for further replies.

stc

Technical User
Aug 23, 2001
25
GB
Hi,

I want to print labels from a database of customer contacts. Each record can have two different types of address, each of which is held as a seperate field, although not all records will have both types of address. I want to generate a label which will display one or the other type of address, based on which type of address data is available. For example, if Address Type A is present, then I do not want to show Address Type B, whether or not there is data available for Address Type B. However, if Address Type A is not available, then Address Type B should be shown.

Any help would be appreciated.

 
Hello there


I had to think for a minute then my first thought was a Union Query but that would be complicated so I tried this in a query with success

create a query to source the data for your labels

add addressType A and AddressType B and in another column
type UseLabelAddress: iif (isnull([addressType A]),[AddressType B],[AddressType B])

hope this helps

regards

Jo
 
Hi Jo,

Thanks for your response. Pardon my ignorance/stupidity, but...

Do you meant to add an extra field called UseLabelAddress, and then as criteria add iif (isnull([addressType A]),[AddressType B],[AddressType B])?

Thanks!

 

No pardon neccessary

copy the line below directly into the top line of a columnn
in the query grid
then run the query and check out your result


UseLabelAddress: iif (isnull([addressType A]),[AddressType B],[AddressType B])


Hope this helps
regards

jo
 
Jo,

Thank you very much, this work really well!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top