TransferSpeadsheet help

M

mike

Hi. I'm writing a procedure that will create a temporary table, and then
export that table to Excel. I keep getting an error on the
TransferSpreadsheet line of code. Here's the line that's generating the error.

DoCmd.TransferSpreadsheet acExport, , [Temp Revenue Template], strPath &
strFile

The error message states:
Run-time error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

The path & filename variables create a valid filename. The [Temp Revenue
Template] table has been created correctly, and all the field names are
valid. I can't figure out what's generating the error. Any thoughts?
 
K

Ken Snell [MVP]

Try this:

DoCmd.TransferSpreadsheet acExport, , "Temp Revenue Template", strPath &
strFile

The table name should be presented as a text string.
 
M

mike

Thanks Ken. That did it.

Ken Snell said:
Try this:

DoCmd.TransferSpreadsheet acExport, , "Temp Revenue Template", strPath &
strFile

The table name should be presented as a text string.
--

Ken Snell
<MS ACCESS MVP>



mike said:
Hi. I'm writing a procedure that will create a temporary table, and then
export that table to Excel. I keep getting an error on the
TransferSpreadsheet line of code. Here's the line that's generating the error.

DoCmd.TransferSpreadsheet acExport, , [Temp Revenue Template], strPath &
strFile

The error message states:
Run-time error '2465'
Microsoft Access can't find the field '|' referred to in your expression.

The path & filename variables create a valid filename. The [Temp Revenue
Template] table has been created correctly, and all the field names are
valid. I can't figure out what's generating the error. Any thoughts?
 

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