I believe it would be the same thing. Run a query to get rid of NULL values. Then run your Count function to count the number of any field. That should get you the total number of records. I hope this helps,
open the table
' Note this is for ADO recordset
Dim Conn2 As ADODB.Connection
Dim Rs1 As ADODB.Recordset
Dim SQLCode as String
Set Conn2 = CurrentProject.Connection ' <<<<Note same as CurrentDb
Set Rs1 = New ADODB.Recordset
SQLCode = "SELECT * FROM [YourTable];"
Rs1.Open SQLCode, Conn2, adOpenStatic, adLockOptimistic
Rs1.movelast
Rs1.movefirst
debug.print Rs1.recordcount 'this is the total number of records
' close it this way
Set rs1 = nothing
Set Conn2 = nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.