Number of records returned on a form

Anton Greffrath
Anton Greffrath used Ask the Experts™
on
I have recently converted my Client's MS Access database to an SQL Database. After the conversion I have the following issue:

I have a Form, based on a Query as the record source. When a subset of the records in the table (that the query is based on) is selected, the number of records returned in the subset is not displayed at the bottom of the form.

When MS Access the information was available. At the bottom of the form where it states: Records 1 of nn where nn is the number of records. after the conversion the nn is not there.

Any one that can assist to get the nn value showing again?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Application Developer
Commented:
In the OnOpen event of the form, put this code:

DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acFirst

Open in new window


This will force the entire recordset into active  memory, and give Access the data it needs to populate the Record 1 of nn display.  :)
(You can get the same result by pressing Control-End when you open the form.)
Distinguished Expert 2017

Commented:
If your BE is a RDBMS, it is far better to severely limit the number of rows returned as the recordset of a form.  You loose any speed advantage you might gain from SQL Server if you bring unfiltered recordsets across the network in order to filter it locally and the larger the recordset, the larger the cost of doing it.

Typically, Access only retrieves enough records to populate the visible rows of a form.  It then requests additional rows in the background or as you scroll through the recordset.  By having to see the n value from Record 1 of n, you are forcing Access to bring down all the records in the recordset whether the user ever will actually need to view them or not.

Many people who convert Access applications from Jet to SQL Server are flabbergasted when the app is sluggish and slower than it ever was with the Jet BE.  Access is tuned to work with Jet/ACE.  You have to take some control to get that same kind of performance against linked SQL Server tables.  And the best place to start is to change your method of filtering.  Let the user enter selection criteria to bring down as few rows as possible.  Then change the selection criteria to go back to the server to get a different set of data.

Author

Commented:
Thanks Paul Cook-Giles, I implemented your solution and it worked 100%

Author

Commented:
Export Exchange Rocks!

Author

Commented:
Thanks Paul. . . .

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial