I would get the record count of the recordsource of the subform, then loop through the last n records and change the recordsource of the subform to " where identityfield = {the identity fields of the last n records}" Off of the top of my head, this is what I come up with...<br>
<br>
J = 0<br>
do while not rst.eof<br>
If j = n then<br>
sql = sql2 & " where [autofield] = " & rst!autofield<br>
sql2 = sql & " and " <br>
end if<br>
j = j + 1<br>
loop<br>
<br>
subform.recordsource = "select * from rst" & sql
(perhaps being a little simplistic about this!)<br>
<br>
SELECT TOP n<br>
tblUser.field1, <br>
tblUser.field2, <br>
tblUser.field3<br>
FROM tblUser<br>
WHERE tblUser.field1 < criteria<br>
ORDER BY tblUser.field2 desc;<br>
<br>
well, you USED to be able to do that!<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.