Importing Data

K

Katie

I would like to write a macro that will open the Import window. I would also
like this to appear as a button on my switchboard. I'm trying to save the
steps of going to File / Get External Data / Import.

I already have it as a shortcut on my toolbar but would really like it on my
switchboard.

Any suggestions?

Thank you.
 
J

Joan Wild

DoCmd.RunCommand acCmdImport
or if you insist on a macro choose RunCommand as the Action, and Import as
the Command.
 
B

Bill H via AccessMonster.com

Make a form with a button labeled import or whatever. Use the code below to
import from multiple excel sheets to multiple tables from a floppy disk.
Works great. Keep in mind that all fields should be identical or the data
won't transfer.

----------------------------------
Private Sub Import_Click()
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "frmaster",
"a:\frmaster.xls", True, "frmaster!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "fracftql",
"a:\fracftql.xls", True, "fracftql!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "fracftsm",
"a:\fracftsm.xls", True, "fracftsm!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "frdashis",
"a:\frdashis.xls", True, "frdashis!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "frentitl",
"a:\frentitl.xls", True, "frentitl!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "frremark",
"a:\frremark.xls", True, "frremark!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "frfltdtl",
"a:\frfltdtl.xls", True, "frfltdtl!"
End Sub
 

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