Open recordset with Max 100 records

livvie

Registered User.
Local time
Today, 03:51
Joined
May 7, 2004
Messages
158
I am opening a recordset in code but as there are alot of records it is slow. Can I limit the number of records retrieved in a recordset ?
 
Last edited:
Create a query (or build an SQL string in VBA) with the words Top 100 in it, e.g.

Select Top 100 [Field1], [Field2], ....
From TableName
Order By [FieldName]

and open the query (or the SQL string) as a recordset.


Note:
The Order By Clause is optional.
If it includes an Order By Clause and there is a tie, more than 100 records will be returned.
.
 

Users who are viewing this thread

Back
Top Bottom