The following are some samples of VBA code that may prove useful.
This is a generic function to check the number of records. In the calling program, create an SQL statement stored in a string. Say you want to know the number of records and store in lngRecs. If the string was called strSQL, you would call this function using
Dim lngRecs as Long
Dim strSQL as String
strSQL = “SELECT * from tblNames”
lngRecs = funRecordCount(strSQL)