choosing postal address from home/business address

everhopefull

Registered User.
Local time
Today, 15:52
Joined
May 10, 2005
Messages
18
Hi,

I am working on printing a letter from a table of contacts. (it will be a report) The contacts have 2 addresses each, home and work and a field which states which one to use for their postal address (e.g postal addr: work)

Here is my question.

Obviously I want to print the correct addr on the letter, so I will have a field which just states address and will populate it depending on the answer to the postal address question, so do I do this it at query level or report level? (the report will come from a query) .

AND the biggie !! HOW do I do it !!

wld appreciate any help ! hope you can follow what I'm trying to do

many tks in advance :)
 
One method would be to deduce the postal address in a query and then use the query as the data source for the report. You could use the iif() function to derrive the column result e.g.

iif(WhichAddress='W',WorkAddress,HomeAddress)

To assign the column a name Prefix the calculation with a field name and then :

e.g.

PostalAddress:iif(WhichAddress='W',WorkAddress,HomeAddress)

Hope this is of some use to you.

NAD
 
Thanks Nad

I think thats exactly what I was looking for I'll give it a go !

rgds
 
Ok I'm back it's not working for me !

I keep getting an invalid syntax error saying I may have entered an operand without an operator. I've tried playing around with it and adding [ ] brackets at various places, but then it seems to think it's a parameter query and looks for more info?

cld the fact that my field names have spaces and are not alltogether like Nad's example be a problem? what I mean is his example calls the field PostalAddress mine is called Postal Address and the same with the output fields again Work Address not WorkAddress? that's probably totally irrelevent ! anyway if anyone cld throw any more light on it ! I wld definately prefer to do it at the query and fill the report with that if poss

many tks :)
 
Ok I got it !

Just needed square brackets around the field names ! just in case anyone else needs this info ! :)
 

Users who are viewing this thread

Back
Top Bottom