0
votes

Im working with MS access front end and SQL server Back end I have 2 similar forms where one form for read-only view is copied from another form which allows edit. The form which allows edit displays the current record count at the bottom with total record count(eg: 1 of 10) whereas the read-only form shows only the current record count(eg:1) only when we move to last record and come back to first record it displays the current record count with Total Record count. What would be the reason for displaying only the current record count instead of current record of total record count in read-only view

1

1 Answers

0
votes

The reason is likely to be that to get the accurate record count of a DAO recordset you need to move to the last record. If you were doing this in code with a DAO recordset you would use the MoveLast method before calling the RecordCount.

You could use the MoveLast and MoveFirst methods with your form to get the count.

Dim rst as DAO.Recordset

Set rst = Me.Recordset
rst.MoveLast
rst.MoveFirst