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

Maybe thsi forum? 1

Status
Not open for further replies.

techsponge

Technical User
Feb 8, 2006
37
US
I posted this in the Forms forum, but seem to have folks stumped?

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 ?
 
Hi,

Have you tried Me!txtDir by any chance? Notice the bang instead of the dot.

I have a feeling that Me is looking for a txtDir method as opposed to a txtDir object.

If you have with no joy, then do this:
Code:
Dim strPathAndFile as String

strPathAndFile = txtDir

DoCmd.TransferText acExportDelim, "AIMEXPORT", "PULLTABEXPORT", strPathAndFile, False


ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Thanks Darrylle~!

I decided to have the user input the sales order number with a prompt.


A star for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top