Project Management Software
Specialists in Project Infrastructure
Sample Microsoft Access VBA
Generic function to return number of records
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
strSQL = "SELECT * from tblNames"
lngRecs = funRecordCount(strSQL)