Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering a Subform to Show Only the Latest Three Records

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I have a "Supplies" form based on the "Supplies" table. I also have a "Procurements" table that is a child of the "Supplies" table. In the "Supplies" form, there is a subform for entering procurements. I want to be able to see certain data for recent procurements, so I can see how many I bought and how long they lasted. But I don't want them all to show up and using say just the last years worth doesn't always get it because some things are bought every few weeks and others maybe every 18 months. So I want it to show the most recent four procurements for the Item I'm on. Can I do it?
 
You may use the TOP predicate in the SQL code of the subform's RecordSource.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Generally in a query you can order something descending so the first values are the latest and then take the Top 4...

I can't be more specific than that without the table layouts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top