Transfer Text

S

slickdock

I posted previously, but I'm not sure I did it right, so I'm going to try
again. I'm not sure of the etiquette, so I hope I'm not being a dope:

I would like to transfer this text with the TransferText command to a txt
file, without quotes (which I get when I select Transfer Type: Export Word
for Windows Merge, or Export HTML), and without spaces at the end of the
field (which I get when I select Transfer Type: Export Fixed Width). I would
like a simple text list, like you see below:

blue
green
pink
orange
red

It works fine in a very basic select query when, while viewing the query
results, I select File, Export, and get the Export Wizard, then under
specifications I select {none} for text qualifier.

The problem comes with a more complex query. The query I want to use this
technique with has parameters. It returns the desired record based on
criteria:

The CustomerID field in the query has the criteria
[forms]![frmCustomers]![CustomerID].

Now when I go to the File, Export, FileType:
Text files, I now get the error message:

Export Text Wizard: Too Few Parameters. Expected 1.

I know that the problem is the criteria, because when I remove the
[forms]![frmCustomers]![CustomerID] criteria, the wizard works fine.

Is there a solution?
Thank you again.
 
S

slickdock

No, the form is open. If I simply run the query, it runs fine. It's only when
I select File, Export, that I get the problem.
 
S

slickdock

Can anyone help? Have I posted this in the wrong group maybe?

slickdock said:
No, the form is open. If I simply run the query, it runs fine. It's only when
I select File, Export, that I get the problem.

slickdock said:
I posted previously, but I'm not sure I did it right, so I'm going to try
again. I'm not sure of the etiquette, so I hope I'm not being a dope:

I would like to transfer this text with the TransferText command to a txt
file, without quotes (which I get when I select Transfer Type: Export Word
for Windows Merge, or Export HTML), and without spaces at the end of the
field (which I get when I select Transfer Type: Export Fixed Width). I would
like a simple text list, like you see below:

blue
green
pink
orange
red

It works fine in a very basic select query when, while viewing the query
results, I select File, Export, and get the Export Wizard, then under
specifications I select {none} for text qualifier.

The problem comes with a more complex query. The query I want to use this
technique with has parameters. It returns the desired record based on
criteria:

The CustomerID field in the query has the criteria
[forms]![frmCustomers]![CustomerID].

Now when I go to the File, Export, FileType:
Text files, I now get the error message:

Export Text Wizard: Too Few Parameters. Expected 1.

I know that the problem is the criteria, because when I remove the
[forms]![frmCustomers]![CustomerID] criteria, the wizard works fine.

Is there a solution?
Thank you again.
 
S

slickdock

Eval did not work, but I took your suggestion to jump through the many hoops
of appending to a temporary table, and that solves it. Not the elegant
solution I was hoping for, but it is a workaround. Thank you.

JimBurke via AccessMonster.com said:
You can try using the Eval function in the criteria - I know that every now
and then I have to use Eval to get criteria to work when referencing a form
control, though I haven't had it happen with using Transfer commands. In the
criteria try using Eval("Forms!frmCustomers!CustomerID").

It may be that when running a query for a Transfer, you can't refernce a form
control. If the Eval function doesn't work, the only other thing I can think
of is to create a table that has all the fields from the query, create a copy
of the query that is an append query and appends all fields to the that table
(make sure you delete all rows form the table before running the query). Not
a simple solution, but if a query can't reference a form control when being
run for a Transfer then I don't see any other solution.
Can anyone help? Have I posted this in the wrong group maybe?
No, the form is open. If I simply run the query, it runs fine. It's only when
I select File, Export, that I get the problem.
[quoted text clipped - 35 lines]
Is there a solution?
Thank you again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top