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

Appending several excel sheets to several tables

Status
Not open for further replies.

khosseini

Programmer
Sep 14, 2006
18
US
I have seen several posts on this issue and taken the tips to heart, so thanks for that. However, I am renewing my VBA knowledge as I haven't used it in over 5 years so I am not sure why the following code isn't working:

Option Compare Database
'The button on the switchboard will gather the modules for each Group and automatically append each worksheet
'to its related table
'Duplicates are allowed

Private Sub cmdButton_Click()

'to append student Data to database
DoCmd.TransferSpreadsheet acImport, , "Students", "G:\Databases\Kelly DB\!TestImport", strFolderName, True, "Worksheet Students!A1:I23"
'to append the FA03 Scholarship Data to database
DoCmd.TransferSpreadsheet acImport, , "FA03", "G:\Databases\Kelly DB\!TestImport", strFolderName, True, "Worksheet FA03!A1:D23"
'to append the SP04 Scholarship Data to database
DoCmd.TransferSpreadsheet acImport, , "SP04", "G:\Databases\Kelly DB\!TestImport", strFolderName, True, "Worksheet SP04!A1:D23"
'to append the FA04 Scholarship Data to database
DoCmd.TransferSpreadsheet acImport, , "FA04", "G:\Databases\Kelly DB\!TestImport", strFolderName, True, "Worksheet FA04!A1:D23"
'to append the SP05 Scholarship Data to database
DoCmd.TransferSpreadsheet acImport, , "SP05", "G:\Databases\Kelly DB\!TestImport", strFolderName, True, "Worksheet SP05!A1:D23"

End Sub
___________________________________________

This is just the test application, but I know I am missing some things, so help is appreciated.

Thanks!

Kendra
 



Hi,

Please explain HOW it is not working?

Is it running to completion by not appending?

Is it appending some but not all?

Is the code erroring and if so, on what statement?

Please by CLEAR, CONCISE & COMPLETE!

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Before I connect this code to the switchboard I would like to run it to be sure that it works. When I click on the module screen the run button is grayed out, when I double click the module itself it just opens the code window. The code will not start therefore, I can't step through and see anything appending.

Sorry I wasn't clear enough the fist time.

Thanks!

Kendra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top