Function to import

M

Mike Comtois

I'm fairly new to modules and functions and was wondering
if anyone could help with this:

I want to have a function where all I have to do is call it
and have the tablename and path as the variables. This is
what I have but I am unsure of how to implement it or if it
should even work:

Public Function Import_XLS(strFileName As String,
strTableName As String)

DoCmd.TransferSpreadsheet transfertype:=acImport, _
spreadsheettype:=acspreadsheetTypeExcel17, _
tablename:=strTableName, _
filename:="T:\Excel_Files\" & strFileName, _
hasfieldnames:=True

End Function


Can someone help please?? I'm using Access 2002
 

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