View Full Version : displaying last/first n records where n is a variable


ivanteo
05-23-2002, 11:05 PM
Hi, i'm trying to query the last/first n records of a table and n is a variable which is entered by the user in a form.
any help?
thanks in advance!

David R
05-24-2002, 08:05 AM
SELECT TOP N....

You'll have to specify what the sort order is, and (I believe) build your query in VBA, since you can't pass variables directly from VBA to stored queries.

ivanteo
05-27-2002, 06:28 PM
Thank you for your reply!
i'm not very familiar with VBA codes and was wondering if you could help me?

David R
05-28-2002, 06:51 AM
http://www.access-programmers.co.uk/ubb/Forum7/HTML/003318.html