Limiting Access report group to 10 records per group when printed? (1 Viewer)

Access_Help

Registered User.
Local time
Today, 03:52
Joined
Feb 12, 2005
Messages
136
Can I limit an Access report group to 10 records per group when printed?
A simple code snippet that I can use and adapt perhaps.
 

Ranman256

Well-known member
Local time
Today, 06:52
Joined
Apr 9, 2015
Messages
4,337
I think youd need to build a form with VB to do this.
youd have a 'reporting' table to hold the temp data to report on
a form would have a list of groups in a listbox.
vb code to cycle thru the list ,selecting 1 group at a time, putting the top 10 records into the report table

empty tReport table
select next group in list
run the append query for that group for only Top 10 recs.
next group
open report

query qaAdd1GrpData2Rpt=
INSERT INTO tReport (tData.*)
SELECT TOP 10 tData.Employee_ID, tData.*
FROM tData where [group]=forms!myForm!lstGrp


Code:
docmd.SetWarnings false
DoCmd.OpenQuery "qdEmptyRptTbl"

For i = 0 To lstGrp.ListCount - 1
   lstGrp= lstGrp.ItemData(i)
   DoCmd.OpenQuery "qaAdd1GrpData2Rpt"
Next

docmd.openReport "rGrpTop10"
 

Users who are viewing this thread

Top Bottom