Hi Everyone,
I have a form that uses a button to run a query that creates table for use in a Word merged document. The query is triggered using VBA code. After the query is run, the code selects the resulting table and then starts the Mail Merge Wizard (Office Links: Merge it with MS Word).
The problem is that in order to select the table, the Main window must be visible. I have the code hide the window once the wizard has been initiated, but this seems awkward.
Does anyone know of a way to start the Wizard and attach the appropriate table without exposing the main window?
By the way, here is a sample of the code I am using:
If [ERSelector] = 4 Then
DoCmd.OpenQuery "aWordMerge_OAA_Locations", acViewNormal
DoCmd.SelectObject acTable, "WordMerge_Contacts", True
GoTo Complete_Merge:
Complete_Merge:
DoCmd.RunCommand acCmdWordMailMerge
DoCmd.RunCommand acCmdWindowHide
Note: ERSelector is just a List box with several entries within it. The one chosen determines the query to run.
Thanks
I have a form that uses a button to run a query that creates table for use in a Word merged document. The query is triggered using VBA code. After the query is run, the code selects the resulting table and then starts the Mail Merge Wizard (Office Links: Merge it with MS Word).
The problem is that in order to select the table, the Main window must be visible. I have the code hide the window once the wizard has been initiated, but this seems awkward.
Does anyone know of a way to start the Wizard and attach the appropriate table without exposing the main window?
By the way, here is a sample of the code I am using:
If [ERSelector] = 4 Then
DoCmd.OpenQuery "aWordMerge_OAA_Locations", acViewNormal
DoCmd.SelectObject acTable, "WordMerge_Contacts", True
GoTo Complete_Merge:
Complete_Merge:
DoCmd.RunCommand acCmdWordMailMerge
DoCmd.RunCommand acCmdWindowHide
Note: ERSelector is just a List box with several entries within it. The one chosen determines the query to run.
Thanks