H
Harmannus
Hallo,
Is there a quick way to count the total numbers of records in a table?
Now i use the below code.
1. Any reasons way this only works on a table that is not linked to a
back-end?
2. Any suggestions for improvements?
Dim db As DAO.Database, rs As DAO.Recordset
Dim Lastrec
' Return reference to current database.
Set db = CurrentDb
' Open table-type Recordset object.
Set rs = db.OpenRecordset("tblOG")
Debug.Print rs.RecordCount
Lastrec = rs.RecordCount
Forms!FrmAbout!totOG = Lastrec
rs.Close
Regards,
Harmannus
Is there a quick way to count the total numbers of records in a table?
Now i use the below code.
1. Any reasons way this only works on a table that is not linked to a
back-end?
2. Any suggestions for improvements?
Dim db As DAO.Database, rs As DAO.Recordset
Dim Lastrec
' Return reference to current database.
Set db = CurrentDb
' Open table-type Recordset object.
Set rs = db.OpenRecordset("tblOG")
Debug.Print rs.RecordCount
Lastrec = rs.RecordCount
Forms!FrmAbout!totOG = Lastrec
rs.Close
Regards,
Harmannus