Sorting RecordsetClone without changing Order By of Form?

Kowalski

Registered User.
Local time
Today, 18:18
Joined
Jul 5, 2007
Messages
121
I would like to get the Min + Max values of the data currently in the form, but without changing the sorting currently on the form.

So I was hoping for this, but it is not working. The data in the recordset are not sorted.
Code:
Set R = Me.RecordsetClone
R.Sort = "SendOn ASC"
R.MoveFirst
MinDate = R!SendOn
R.MoveLast
MaxDate = R!SendOn

Any other method except iterating through the entire recordset?
 
I see. Index seems to be the correct method, but Index fails on RecordsetClones. Perhaps iterating through the recordset will have less of a DB impact, than creating a new TableDef recordset.
 
I am not sure what you have done but did you follow the example -exactly - in the link? I tried and it works fine, also for the recordsetclone.

Iterating is normally the last choice. DMAX/DMIN can also be used on the original recordset. You can also use the functions Min and Max on the field
 
Last edited:

Users who are viewing this thread

Back
Top Bottom