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

Export Query and Form Parameter

Status
Not open for further replies.

techsponge

Technical User
Feb 8, 2006
37
0
0
US
I am attempting to export an Access Query as a text file. The query parameters are defined by a form that has a primary key which is an autonumber [PK11] The choice of Sales Order Number defines the query result set.

In the [Sales Order] parameter in the query, i have [Forms]![frmSalesForm]![PK11], I am prompted to enter a sales order number and the query runs fine within Access.

I then try to launch the query using:
Code:
DoCmd.TransferText acExportDelim, "AIMEXPORT", "PULLTABEXPORT", Me.txtDir, False

I get a parameter error!!! If I change the parameter to a set Sales Order - the process runs fine!!!

Any ideas or any thoughts?
 
Yes I do. I am launching from a cmdButton on the sales form. If I hard code a sales number in the query, the file exports great from the button.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top