Results 1 to 2 of 2
  1. #1
    Tandem is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2016
    Posts
    15

    Full Screen Application - Using WordMailMerge

    Sorry if this is posted in the wrong subforum. It relates to macros, forms, and queries.



    Heres the scoop:

    I have a full screen form called frmMailMerge which shows a list of people who are on the email list, based on a query. At the top is a button which is intended to run the mail merge wizard.

    The macro I have on this button:

    1) OpenQuery: qryMailMerge
    2) WordMailMerge

    The issue is that WordMailMerge needs a query or a table as a reference. When my macro opens qryMailMerge, it opens behind frmMailMerge and I get an error because the WordMailMerge is trying to use the form instead of the query which was just opened.

    I can add another command to the macro which first closes frmMailMerge, then opens qryMailMerge, then runs WordMailMerge, but doing this breaks the full-screen nature of the application, so I need to figure out how to get the query to open on top of the form (I know there is no popup). Or perhaps I could open the query behind the form, then somehow set the focus to the query before the mail merge?

    If anyone has an idea for a macro/code please chime in.
    Thanks.

  2. #2
    Tandem is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2016
    Posts
    15
    Figured it out This is my code in case anyone else needs it:

    DoCmd.OpenQuery "qryMailMerge", acViewNormal, acEdit
    Call DoCmd.SelectObject(ObjectType:=acQuery, ObjectName:="qryMailMerge", InDatabaseWindow:=False)
    DoCmd.RunCommand acCmdWordMailMerge

    Seems to work as intended.

    Edit: Don't forget that all forms on top of the query must not be set to modal. There is probably a way to expand the code to account for this, but I can't think of anything right off.

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

Similar Threads

  1. Form full screen
    By chiaro59 in forum Forms
    Replies: 4
    Last Post: 10-24-2014, 04:21 AM
  2. Open Report In Full Screen (Not Maximized)
    By Trek-Fan in forum Reports
    Replies: 3
    Last Post: 07-29-2014, 02:22 PM
  3. Full Screen Form on Access 2007
    By fekrinejat in forum Forms
    Replies: 1
    Last Post: 02-08-2013, 02:53 PM
  4. Replies: 11
    Last Post: 06-05-2011, 09:51 PM
  5. Full App - Cardfile Application
    By pkstormy in forum Sample Databases
    Replies: 0
    Last Post: 08-24-2010, 07:23 AM

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