Help with displaying mailing address

J

Jacqueline

In my Access 2000 mdb I am trying to create a report that
must choose the correct mailing address to send the
letter to...

The database holds 3 sets of mailing address for the
medical school applicants...Present...Permanent and Other

If I was using the present mailing address info in a
query it would be over 4 columns:

1. Address1

2. Display_Address2: IIf(IsNull([Address2]),[City] & ", "
& [Province],[Address2])

3. Display_Address3: IIf(IsNull([Address2]),[Postal_Code],
[City] & ", " & [Province])

4. Display_Address4: IIf(IsNull([Address2]),"",
[Postal_Code])

My problem is this...on that form there is also a
question which asks:
To which address do you want the final results sent:
Present...Permanent...Other (these are 3 checkboxes)

My ? is: if a student checks off they want their final
results sent to...say their Present address...how do I
display the correct address in the query that runs the
report?
I know it must be some kind of IIF statement that would
need to check which of the 3 boxes are checked...but with
the way the address is broken down in my above sample
address it seems a little confusing...

thanks for the help!
 
A

Allen Browne

Would you consider replacing the 3 check boxes on the form with an option
group? The group would have 3 buttons like the check boxes, but when they
choose one of them, it automatically deselects the others.

1. Open the form in design view.

2. Click the Option Group in the Toolbox, and click on the form. Access adds
a "frame" to the form.

3. Use the Properties box to change the name of the option group to (say)
grpAddress .

4. Click the Option Button in the Toolbox, and click INSIDE the option group
frame.

5. Repeat step 4 for the other two buttons.

6. Now set up the calculated field in your query to supply the correct
fields, depending on the value of the option group:

Display_Address: IIf(Forms!MyForm!grpAddress = 1, ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top