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

Import Excel to MSAccess with prompt for filename

Status
Not open for further replies.

datavisions

Programmer
May 30, 2001
35
CA
I'm trying to use the DoCmd.Transferspreadsheet to IMPORT an Excel spreadsheet into an existing table. It works fine if I specifically name the Excel file to be imported, but if I leave off the import filename (like you can do on exports), it won't prompt me for a filename and location, but rather gives me an error message. What are my alternatives/
 
Build the requirement for an imput filename into a form that transfers the spreadsheet. Even to using a common dialog to browse for the input file.

Steve King

txtInputFile_AfterUpdate

If Len(Me.txtInputFile)>0 Then
If Len(Dir(Me.txtInputFile))>0 Then
'File has been specified and verified
'so run the transfer spreadsheet code
End If
End If

End Sub Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top