Results 1 to 4 of 4
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    OR in Mail Merge Fields? (2003)

    I have a document with numerous and reasonably complex mail merge fields.

    In some of them, I want to print A if the source data is null OR is a question mark, and print B if the source data is anything else.

    Can that be done? And if so, what's the syntax? (All the curly brackets, double quotes, spaces, etc. are driving me batty as I try to figure it out.)
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OR in Mail Merge Fields? (2003)

    Are you using Access as data source? If so, the easiest solution is to create a query in Access with a calculated field, and use that for the mail merge.

  3. #3
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: OR in Mail Merge Fields? (2003)

    I have used Excel in the past, but have converted the application over to Access. I MAY go back to Excel for one thing or another, but my desire is to put as much as I can into Access. (I am very comfortable in Excel, but am really just a beginner with Access.)

    You make a good suggestion. It would be a bit of a challenge for me to do it, but I'd learn a bit in the process. I will give it a shot.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OR in Mail Merge Fields? (2003)

    The expression in the query would look like

    MyCol: IIf(IsNull([AField]) Or [AField] = "?",A","B")

    where AField is the name of the field to be tested, and MyCol can be replaced by the name you want to give the calculated column.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •