Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter query and Mail Merge 1

Status
Not open for further replies.

vig

MIS
Jan 29, 2000
14
US
I set up a parameter query that prompts for month and year. I need these fields and additional query info in a word mail merge. Even after saving, the run will not export into a txt file...I get &quot;too few parameters, expected 2&quot; as an error in the export text wizard. Using this other method: Tools/Office Links/Merge It with MS Word does not work either with the prompt parameter. Both methods work fine if I type the month and year criteria directly into the query design. Any ideas to help keep the user away from the query design window. Thanks. <br><br>
 
I have better success with this older method.<br>--------------------------------<br>Private Sub Command0_Click()<br>On Error GoTo Err_Command0_Click<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim stAppName As String<br><br>&nbsp;&nbsp;&nbsp;&nbsp;stAppName = &quot;C:\Microsoft Office97\Office\WINWORD.EXE c:\Mydoc.doc /Mmacroname&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Call Shell(stAppName, 1)<br><br>Exit_Command0_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br><br>Err_Command0_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;MsgBox Err.Description<br>&nbsp;&nbsp;&nbsp;&nbsp;Resume Exit_Command0_Click<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br>-------------------------------------<br>Next open your Word doc and connect to your Query instead of a table so when Word launches it should prompt for the parameters.<br><br>A better way would be have a form where you find a record that matches your parameters of your query.<br>And change your query to look at the form instead of Prompting. Then have a button to launch Word.<br>When Word opens its datasource is the changed query and it will just show the records and not prompt at all.<br><br>So to recap <br>1. Form In Access finds the record <br>2. Query looks at form not Prompts<br>3. Button launches Word <br>4. Word Doc is new query<br>5. Create a macro that trints it out.<br><br>I wrote a Quoting system that did this very thing.<br>It was fantasic.<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thanks for your help. I have a few follow up questions...this process is new to me.<br><br>1. Form in Access finds a record with all the fields including the month and date needed for the mail merge.<br><br>2. Query looks at form not prompts: How is this set up. Filter by selection in form? <br><br>I'll go on to the other steps when this is sorted out. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top