I have a form with a button, which when clicked, imports a table from excel. This works fine. However, I am wondering if there is a way to notify the user of the number of records that were imported. If so, how? Thanks for any help.
If you will always have an empty table that you import to, this function will work. If not, you will need to modify it to account for the records already in the table.
Function ImportData()
On Error GoTo ImportData_Err
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim intCount As Integer
Dim strMsg As String
DoCmd.TransferSpreadsheet acImport, 8, "tblTestImport", "c:\testimport.xls", True, ""
Set db = CurrentDb
Set rst = db.OpenRecordset("tblTestImport")
intCount = rst.RecordCount
MsgBox "Imported " & intCount & " records."