0

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

user2514925
  • 931
  • 8
  • 33
  • 56

1 Answers1

0

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
jhTuppeny
  • 820
  • 1
  • 11
  • 16
  • Thanks a lot for the response it works fine when i give it in Form_Load method!But it is not working when Refresh/Filter applied – user2514925 Feb 10 '16 at 09:34
  • 1
    You would probably need to do this each time you reload the form's recordset - this will happen when you refresh or filter the form. – jhTuppeny Feb 10 '16 at 10:09