Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automate Mail Merge to Word (Access 2000)

    I created the Function explained in article Q209976 "How to use Automation to Run Word 2000 Mail Merge from Access" and changed it just a bit so it would run five different merges, one after another. Occasionally one of the Access tables won't have any data in it, and that is where I run into problems and the merge won't continue. Is there a way I can check the Tables to be sure they have data before it starts the merge, and then include some kind of If..Then statement in my Function?

    Your help is much appreciated. Thank you!

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automate Mail Merge to Word (Access 2000)

    This sounds like the perfect situation to use the DCount() function. You can specify a specific table and field in the DCount() function in a conditional statement (such as If...Then).

    Try something like this:<pre>'.....(insert into your code)
    If DCount("<AnyField>","<TableInQuestion>") > 0 Then
    'Execute Merge
    End If
    '.....(Repeat for each table in question)</pre>

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automate Mail Merge to Word (Access 2000)

    That worked great. Thanks!

Posting Permissions

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