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

Import spreadsheet using command button

Status
Not open for further replies.

ambs24

Technical User
Jan 28, 2002
6
US
I'm looking for a way to set up a command button that will perform the same operation as the import spreadsheet wizard. The wizard is simple enough, but the operation will be performed daily and the parameters will be identical each time, so it seems like a command button would save my users a lot of time. Does anyone know the best way to do this?

Thank you!
 
The proper code for this is....

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "NameofTableForSpreadsheettoBeSavedTo", "PathandNameOfFiletoImport"

add ,True to the end if the file has field names you wish to preserve. "As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top