I believe that function like DLast can be a little flaky, but I have never had an issue with DCOUNT when simply counting the number of records in a table or query. I use it quite a bit. It is very straightforward, i.e.
Code:
myCount =Dcount("*","TableName")
Alternatively, I have created a User Defined Function to do record counts in the past too, i.e.
Code:
Function MyRecordCount(myQuery As String) As Long
' Counts records in a query
Dim myRecords As Long
Dim myRS As DAO.Recordset
Set myRS = CurrentDb.OpenRecordset(myQuery)
If Not myRS.EOF Then
myRS.MoveLast
MyRecordCount = myRS.RecordCount
Else
MyRecordCount = 0
End If
End Function
You just need to be sure to select the DAO reference in the VB Editor in order to use it.