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!

Importing Table Structure 1

Status
Not open for further replies.

RSedlacek

Programmer
Oct 5, 1998
59
US
Is it possible to import just Field names with Data Types without the data from an Excel file into Access? If so, could someone please explain the process?

Thanks in advance!
 
There may be a direct solution but this is the closest I can think of:

DoCmd.TransferSpreadsheet acImport, 8, _
"tblYourNewTableName", "C:\YourPath\AndXlsNameHere.xls",True, "YourSheetName!A1:F2"

I've tried it with the range set to A1:F1 (row containing column names) but that resulted in text fields in the new table, regardless of the XL setting. It seems that some sample data is needed to determine the type.
As a workaround you could, eg. run a Delete qry after the table has been created.

TomCologne
 
Works like a charm! Thanks for your help!!!!

This is the first time I've used the VB Module feature of MS Access or VB for that matter. I'm shocked...I figured it out on my own in less than 30 minutes. Looks pretty powerful. I'm going to have to learn more about it.
 
Glad it worked, thanks for the star.

VBA has a couple of features that I find helpful, eg Immediate Window, Locals Window or for editing "Comment Block/Uncomment Block" buttons etc. Using the interface wisely can save a lot of time and nerves.

Have fun,

TomCologne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top