Hello!
No question here, just a procedure for the archive.
Search critera:
count records imported count data imported count number of rows
imported
count number of records imported record import count automatically
import
and count records prompt for number of records imported import count
auto-import records
autoimport records count records before and after
Sub ImportDataAndCountNumberOfNewlyImportedRecords()
Dim NumRecordsBeforeImport As Double
NumRecordsBeforeImport = DCount("*",
"tblImportMTVolumesDataIntoThisTable")
'Example of calling the MS Access macro that auto-imports your
data
' DoCmd.RunMacro "mcrOpenImportSpecs&CountRecordsImported"
'Example of using the VBA TransferText method to auto-import your
data:
DoCmd.TransferText acImportFixed, "MTVolumesImportSpec",
"tblImportMTVolumesDataIntoThisTable", "C:\Documents and
Settings\user\Desktop\Temp\Aug04Vols.txt", False
NumRecordsAferImport = DCount("*",
"tblImportMTVolumesDataIntoThisTable")
MsgBox NumRecordsBeforeImport & " records existed in the table
before the data import."
MsgBox "There are now " & DCount("*",
"tblImportMTVolumesDataIntoThisTable") & " total records after the
import."
MsgBox DCount("*", "tblImportMTVolumesDataIntoThisTable") -
NumRecordsBeforeImport & " records were imported."
End Sub