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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating a parameter query

Status
Not open for further replies.

WaltLukeIII

Programmer
Jun 28, 2000
199
US
I have a parameter query and I have written amodule that will update it with the parameter that I want and then export it. However when I try to use the .OpenQueryDef(&quot;&quot;) method I get a message saying vb does not support this function.<br>any help is appreciated <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
1) Why are you setting a parameter through a module?<br>2) What are you trying to do with the .OpenQueryDef(&quot;&quot;) statement?<br>3) What type of file are you exporting? .xls?&nbsp;&nbsp;.txt?<br> <p>Jim Lunde<br><a href=mailto:compugeeks@hotmail.com>compugeeks@hotmail.com</a><br><a href= Application Development
 
I have a table containing a lot of records from this table I need to export a ceartain group of those records to an excel spreadsheet. I was trying to export them using a parameter query. <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
How many parameters do you need? If you are using one, see below. If more than one, then add the appropriate fields, and criteria following the example.<br><br>This is how I would do it:<br><br>1) Create a small pop up form with either a text box or combo box for your parameter, and an OK and Cancel button. Let's call it frmParameter. And let's call the combo box cboParam.<br>2) Create a query that pulls whatever fields you desire.<br>3) In the the criteria for the parameter field put this: [Forms]![frmParamter]![cboParam].<br>4) Now on the code of the OK button use the TransferSpreadsheet method to export the query, and then close the form.<br>5) The cancel button should just close the form.<br><br>HTH<br> <p>Jim Lunde<br><a href=mailto:compugeeks@hotmail.com>compugeeks@hotmail.com</a><br><a href= Application Development
 
I have this code and have set the &quot;numero1&quot; variable. but it still asks me for the num when I push the button<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If found = False Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info = &quot;PARAMETERS num Double; SELECT * FROM [Quoted Parts] &quot; & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;WHERE
# said:
= &quot; & numero1 & &quot; ORDER BY &quot; & _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Location, Service, [Part #]&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set definition = db.CreateQueryDef(&quot;ExportQuery&quot;, info)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set definition = db.QueryDefs(&quot;ExportQuery&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;definition.Parameters![num] = numero1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.TransferSpreadsheet acExport, 5, &quot;ExportQuery&quot;, path, -1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;exported Quote # &quot; & numero1<br> <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top