Show the Last Six Records in a Microsoft Access Subform
Question details
Show the most recent six subform records when the main form changes, while retaining all records for scrolling.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A main form displays equipment service history in a subform ordered by a sequential line number.
- Observed behavior
- The subform should move to the latest service record and show approximately six recent rows without limiting the recordset.
Confirm the subform control name on the main form and identify the date or sequential field that defines the latest record. Ensure the subform is linked to the main form through its Link Master Fields and Link Child Fields properties.
Move the Subform to Its Last Record on the Main Form's Current Event
Use this approach to keep the complete subform recordset while moving to the latest record whenever the main record changes.
The last record is only the most recent one if the subform's record source is sorted appropriately. Setting the last record as current scrolls it into view, but the exact number of visible rows depends on the subform's size and layout.
Open the subform's record source query in Design View and sort the sequential line-number or service-date field in ascending order, so the latest record is last.
Open the main form in Design View and size the subform control to display approximately six rows. Use a continuous forms or datasheet view for the subform.
Select the main form, open Property Sheet > Event, and choose [Event Procedure] for On Current. Click the ellipsis button and add this code, replacing ContractSubFormA with your subform control name: Private Sub Form_Current() Me!ContractSubFormA.Requery With Me!ContractSubFormA.Form.RecordsetClone If Not (.BOF And .EOF) Then .MoveLast Me!ContractSubFormA.Form.Bookmark = .Bookmark End If End With End Sub
Open the main form in Form View and move between main records using the navigation buttons. Verify that the correct linked subform records appear, the latest record is in view, and you can scroll back to earlier records.

Review Service Records in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar interface for working with exported service records. It does not run Access forms or VBA, but spreadsheet files can be moved between WPS and Microsoft Office.

Frequently Asked Questions
Why use the main form's On Current event?
The On Current event runs when the main form moves to a record. Add the event procedure through the main form's Property Sheet > Event tab to update the subform during navigation.
How do I find the subform control name?
Open the main form in Design View, select the subform control, and check the Name property in the Property Sheet. Use that name in the VBA code; it may differ from the name of the form displayed inside it.
Will a TOP 6 query let users scroll to older records?
No. A TOP 6 query limits the records returned. To retain older records for scrolling, use the full linked record source and move to its last record instead.
What if the last record is not the newest service record?
Open the subform's record source query in Design View and sort the field that defines recency, such as a service date or sequential line number, in ascending order. Add a unique secondary sort field if dates can be duplicated.
Can WPS Office run this Access subform?
No. The subform and its VBA code require Microsoft Access. For spreadsheet review in WPS, export the records from Access to an Excel file and open that file in WPS Spreadsheets.




