TransferSpreadsheet HELP

P

Pete Beatty

I am trying to use the TransferSpreadsheet capability to transfer a portion
of a table to access and am having a problem. Every time I execute the code
below I get the following error message:
"run-time error 3011"
"The Microsoft Jet database engine could not find the object 'SELECT
Units.District, Units.Unitnumber, Units.Unittype FROM [Units] WHERE
[district] = 30' description. Make sure the object exists and that you
spell its name and the path name correctly.

The Table "Units" is available in the project and it is spelle correctly.
WHAT AM I MISSING??

dim strSQL as Variant
dim TempDist as Variant

TempDist = 30

strSQL = "SELECT Units.District, Units.Unitnumber, Units.unittype FROM
[roster] WHERE [district] = " & [TempDist]

DoCmd.TransferSpreadsheet acExport, , strSQL, "E:\Units.xls"
 
C

Cindy M -WordMVP-

Hi Pete,

It always helps a lot if you post in which programming environment you're
working, and which version. I'm thinking this is Access, so you might want to
go to an appropriate Access newsgroup. From what little I know about the Jet
engine and Excel, if "Units" is a worksheet name (rather than a range name) oyu
would probably need to qualify it with a $ (Units$)
I am trying to use the TransferSpreadsheet capability to transfer a portion
of a table to access and am having a problem. Every time I execute the code
below I get the following error message:
"run-time error 3011"
"The Microsoft Jet database engine could not find the object 'SELECT
Units.District, Units.Unitnumber, Units.Unittype FROM [Units] WHERE
[district] = 30' description. Make sure the object exists and that you
spell its name and the path name correctly.

The Table "Units" is available in the project and it is spelle correctly.
WHAT AM I MISSING??

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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