By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

TransferSpreadsheet Command

P: n/a
Hi,

I'm automating an import done manually through Get External Data
I have assigned the below code to the onclick event of a command button
on a form but I am getting errors.

DoCmd.TransferSpreadsheet (acImport,acspreadsheettypeexcel97,
allaccounts,"D:\PersonalData\all accounts.xls", -1)

I'm not sure why but I am getting a Syntax error.

Also I am eventualy going to get the user to select the file they want
to import, and I can do this through a box on my form, but how do I
refer to the box in the code above?

Thanks

Dec 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 9 Dec 2006 07:55:11 -0800, keri wrote:
Hi,

I'm automating an import done manually through Get External Data
I have assigned the below code to the onclick event of a command button
on a form but I am getting errors.

DoCmd.TransferSpreadsheet (acImport,acspreadsheettypeexcel97,
allaccounts,"D:\PersonalData\all accounts.xls", -1)

I'm not sure why but I am getting a Syntax error.

Also I am eventualy going to get the user to select the file they want
to import, and I can do this through a box on my form, but how do I
refer to the box in the code above?

Thanks
What is allaccounts?
Is that the actual name of the table you wish to import the data into?
Then it must be a string value. Enclose it within quotes "allaccounts"

DoCmd.TransferSpreadsheet (acImport,acspreadsheettypeexcel97,
"allaccounts","D:\PersonalData\all accounts.xls", -1)
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Dec 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.