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

Import from Excel into Access

Status
Not open for further replies.

darude

Programmer
Jun 23, 2003
138
US
Hello All,
I have an MS Access application that imports data from many different excel spreadsheets located in a directory by member name. The problem is that I have an import routine in Access for each member that references the folder on the directory where the member is stored (see routine below). I was wondering if there is a generic call so I can only have one routine. If my client adds new members then I have to go into the application and add another routine. Thank you in advance.

Sub ImportSAHTF()

If Me.txtWhatForm = 1 Then
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="EUF", _
FileName:=CurrentProject.Path & "\EUF\sahtf\sahtf access.xls", _
HasFieldNames:=True
End If

End Sub



 
Sub Importxxx(client As String)

If Me.txtWhatForm = 1 Then
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="EUF", _
FileName:=CurrentProject.Path & "\EUF\" & client & "\" & client & " access.xls", _
HasFieldNames:=True
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top