Results 1 to 2 of 2
  1. #1
    jpfulton248 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2014
    Posts
    4

    Help with If Statement in Access Report

    Hi. Not great with Access but I managed to stumble through setting up a database with forms, reports etc. Need to make a change to a report that I currently use to create labels. This is a screen shot of what I currently have:

    CHURCH_NAME -- The church name
    CHURCH_2 -- the database has a separate field if the church name is too long for one line
    Address -- physical address of street number and street name
    =Trim([City] & ", " & [State] & " " & [Zip]) -- physical address of City State Zip

    Click image for larger version. 

Name:	Untitled-1.jpg 
Views:	10 
Size:	88.1 KB 
ID:	21535

    The database also includes fields for the mailing address. Some records have only a physical address, some have a physical and mailing address, and some only have a mailing address. I need the report to use the mailing address if it exist. For records with only a physical address and no mailing address, use the physical address.

    The mailing address fields are:

    MAIL_ADDR
    MAIL_CITY
    MAIL_STATE
    MAIL_ZIP



    Please help. Thank you in advance!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    No IF needed, Build a UNION query to pull the diffent addresses

    qnAddrUnion =
    Select name, MailAddr, MailCity, MailState, MailZip from table where [physical address] = null
    union
    Select name, PhysAddr, PhysCity, PhysState, PhysZip from table where [Mail address] = null

    Then if needed you can run a query on qnAddrUnion to remove the duplicates:
    select distinct * from qnAddrUnion

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 10-29-2014, 11:48 AM
  2. If Statement Condition - Opening Report
    By geraldk in forum Reports
    Replies: 3
    Last Post: 07-10-2013, 10:26 AM
  3. Logic statement to select report
    By AKQTS in forum Reports
    Replies: 7
    Last Post: 07-30-2010, 12:52 PM
  4. Help with if statement in report
    By Nixx1401 in forum Reports
    Replies: 1
    Last Post: 07-02-2010, 07:43 AM
  5. If Statement in Report
    By Nixx1401 in forum Reports
    Replies: 3
    Last Post: 07-01-2010, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums