Re: Show last 'X' records in a subform

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Create a 'TOP' query based on the table:

SELECT TOP 5 somedate, otherfields
FROM sometable
ORDER BY somedate DESC;

Then base the subform on a query of that query ordered by the ascending date should give you what the users want. The '5' should be whatever number of records you need.

SELECT *
FROM topquery
ORDER BY somedate ;

HTH
John
##################################
Don't Print - Save trees

Steve S wrote:
Have a form that the user uses to input data to create new records. these records are displayed in a subform just below the data entry fields. I now have the subform set to display all records in reverse order so the user can see the latest added at the top fo the subform(decending order). this is confusing for some users ( if not all). they want to see the latest record entered at the bottom of the subform (ascending order) which means they have to hit the scroll bar to get to the bottom of the list. Pain in the...
Is there a way to set the subform properties to show the last X records in ascending order instead of the first x records???
Any help is appreciated.
.



Relevant Pages

  • Re: Suggestions Please - Subform Results Export to Excel
    ... --the name of the subform control ... --the query or table that is the record source of the main form ... now a parameter box appears requesting the ProjectID to base the query. ... Dim strSQL As String ...
    (microsoft.public.access.formscoding)
  • Re: Suggestions Please - Subform Results Export to Excel
    ... In your situation the form and subform are both based on the same table. ... Setting up the query with criteria like ... In the criteria row for ProjectID, ... Record Source: SELECT tblHours_Worked.ProjectID, ...
    (microsoft.public.access.formscoding)
  • Re: VB record set not refreshing with new id focus.
    ... The place that can change the idrecon value in the subform ... Now my subsubform or the 'grandchild' form is completely controlled by VB. ... In the 'onopen' event of the grandchild formI run a query passing in the ...
    (microsoft.public.access.modulesdaovba)
  • Re: updating subform
    ... You can just create a saved append query that will pick up the latest round ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ... was mailed because the letters will be the same boby information it would ... I tried your code in the subform after update with no change I will change ...
    (microsoft.public.access.modulesdaovba)
  • Re: Still Struggling...
    ... The subform for Titles. ... When I did the query, I also pulled in tblTitles. ...
    (microsoft.public.access.gettingstarted)