Excel choosing an excel file to import into Access

Joined
Jun 30, 2011
Messages
2
Reaction score
0
Hi

I found this code that lets the user enter an excel file and then import into access.
End Sub
'Private Sub Command126_Click()
On Error GoTo Err_Command126_Click
Dim strFile As String
strFile = InputBox("What is the name of the file?")
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "MyTableName", _
"f:\" & strFile & ".xlsx", False, "WorksheetName!A1:S200"

End Sub

MyTableName is my access table.

It bombs at "WorksheetName!A1:S200".
The path name to the f drive is to a memory stick.


JAM
 
Joined
Jun 30, 2011
Messages
1
Reaction score
0
Hi ,

Please send me the code for updating data's to database when check box is clicked in the datagrid view
 

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