Upload an Excel Spreadsheet into an Access 2010 table using a button on a form

I have a file "export.xlsx" that is imported on a daily basis to an Access 2010 table "FD Service Desk".  I would like to create a form that has a button on it that once clicked, will upload the spreadsheet into the table.  I can create the form and button, just not sure what coding is necessary to actually upload the file into the table.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
place this sample code in the click event of the button

docmd.transferspreadsheet acimport,10, "[FD Service Desk]", "C:\Folder\export.xlsx", true, "sheet1!"
razorbackfanAuthor Commented:
spreadsheet is uploaded but a new table is created each time i click the button.  I need the data to be appended to the existing table.
Rey Obrero (Capricorn1)Commented:
you can do it by first
import the excel to a temporary table

docmd.transferspreadsheet acimport,10, "tmpTable", "C:\Folder\export.xlsx", true, "sheet1!"

then run an append query that appends the records from the tmpTable to "[FD Service Desk]"
something like this

Insert Into [FD Service Desk]
select tmpTable.*
from tmpTable
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

razorbackfanAuthor Commented:
I was hoping for a solution that only required one step to simplify the process
Rey Obrero (Capricorn1)Commented:
there is a one step solution, (not simple though)
by reading the excel file and appending to the table using vba.

just stay with the two step process.
Rey Obrero (Capricorn1)Commented:
you can place the two steps in the click event of the button

private sub cmdImport_click()

'import the excel file
docmd.transferspreadsheet acimport,10, "tmpTable", "C:\Folder\export.xlsx", true, "sheet1!"

'insert the imported records to the final table
currentdb.execute "Insert Into [FD Service Desk] select tmpTable.* from tmpTable "

end sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.