Affichage des articles dont le libellé est Forcing page break on subreport after 2 records. Afficher tous les articles
Affichage des articles dont le libellé est Forcing page break on subreport after 2 records. Afficher tous les articles

Forcing page break on subreport after 2 records

mercredi 18 février 2015

I have been working on this for over a week in Access 2010 and I know that I am almost there, but need some help getting over this last hurdle as I have a severe case of tunnel vision on this while I am trying to get it to work.



I have a Main Report based on my Element table and a subreport based on my OTC table. There is a one-to-many relationship between the Element and the OTC table.



My Master / Child Fields between the two reports are as follows:



ElementID;GroupNum



My SQL for the Main report is:




Code:



SELECT Val(DCount("*","Element","ElementID=" & [ElementID] & " AND Step <" & [Step]))\2 AS GroupNum, Element.ElementID, Element.ProcessID, Element.ModelID, Element.Step, Element.ElementDescription, Element.RevDate, Element.GPCFS, Element.TrainingGate

FROM Element

GROUP BY Val(DCount("*","Element","ElementID=" & [ElementID] & " AND Step <" & [Step]))\2, Element.ElementID, Element.ProcessID, Element.ModelID, Element.Step, Element.ElementDescription, Element.RevDate, Element.GPCFS, Element.TrainingGate

ORDER BY Element.ElementID;



My SQL for the subreport is:




Code:



SELECT Val(DCount("*","OTC","ElementID=" & [ElementID] & " AND OTCID <" & [OTCID]))\2 AS GroupNum, OTC.*

FROM OTC

ORDER BY OTC.ElementID;



As an example in testing this report, I am looking at a specific Element with 33 records and a total of 72 OTC records. Each of the 33 records can have 1 or 2 or 3 or up to 4 OTC records but the report is only 17 pages which tells me that the page break is occuring based on the ElementID and not on the OTC records.... Sorry - severe case of tunnel vision as I can't see where I went wrong. Would appreciate another pair of eyes to look at my SQL and point me in the right direction. Thank you.

Forcing page break on subreport after 2 records

Labels