Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Location
    England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail merge question using Yes/No fields in Office (XP)

    I have an Access database with fields as data type Yes/No e.g. pets / no pets

    I want to use these in a Word mail merge using If...Then...Else but can't get it to work in office 2000.

    For example

    For example:
    IF Field Name <<Pets>> is Equal To TRUE ...
    Insert this text 'We have pets'
    Otherwise insert this text 'No pets thanks'


    This works fine using Office XP but when I tried it using Office 2000 always got the 'no pets thanks' response.

    any ideas?

    Thanks

    Colin Riddington

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail merge question using Yes/No fields in Office (XP)

    I think this is because Word 2000 didn't really have the equivalent of a Boolean field - to test that try checking for a -1 in Word 2000. In point of fact, we usually build the expressions in Access so we don't have to use If Then Else constructs in a Word document.
    Wendell

  3. #3
    New Lounger
    Join Date
    Dec 2002
    Location
    England
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge question using Yes/No fields in Office (XP)

    Thanks for your reply. I assume you mean that you would run queries in Access to test for the condition & then run separate mail merges for both the Yes/No conditions. If so, this seems a longwinded method to me. My request seems such a basic requirement for a mail merge field usage that I'm surprised it didn't work before XP.

    Anyhow thanks again

    Colin Riddington

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail merge question using Yes/No fields in Office (XP)

    No, not separate mail merges - all I would do is run a query that checked the Pets field and if it had the value Yes I would return the phrase "has pets" as a text string, and if it had the value No, I would return the text string "has no pets" (that's done using an Access IIF() function in a query), and it would all be done in one mail merge. Bear in mind that the MailMerge function has been around since about version 2 of Word for Windows, and was originally based on the idea of a text file as a data source, where boolean field types don't make much sense. When Office 4.3 came along with Access, people began thinking about Access data sources, but the storage mechanisms in Word weren't geared to binary data. When Word adopted VBA, things got much closer together, and finally you get true boolean support in 2002. In fact the approach you are using in 2002 has been the source of some problems, as there have been some recent threads dealing with that approach not always working correctly. Check out <post#=213606>post 213606</post#> for example.
    Wendell

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge question using Yes/No fields in Office (XP)

    Hi Colin:
    I'm not sure what you're using for your IF field. If you use -1 as the true condition, your mailmerge should work in Word 2000. i.e. something like:

    { IF { MERGEFIELD have_pets} = -1 { MERGEFIELD LastName } }

    Hope this helps.

Posting Permissions

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