SubReport not printing on MainReport

stevee2002

New member
Local time
Today, 13:22
Joined
Apr 26, 2008
Messages
1
hey guys, i've been struggling for days with this problem, i'd love to get your advice:

TABLES:
I have a database pulling 20,000 records from (tblMain) with key record as [TagNumber]
I have a subtable (tblSub) pulling a list of associated tags ([TagIndex], [Tag1], [Tag2], etc.) for every [TagNumber] record in tblMain when [TagNumber]=[TagIndex]

FORMS:
I have an unbound form (frmSearch) with a [Search] text box to search records in tblMain
I have (frmMain) that contains text boxes for all data and generates from qryMain based on criteria in [frmSearch]![Search]
I have (frmSub) that generates from qrySub based on [TagNumber] in frmMain where [TagNumber]=[TagIndex] (master/child)

REPORTS:
I have (rptMain) based off of qryMainPrint that pulls all data with criteria set to [frmSearch]![Search]
I have (rptSub) that pulls the subtags from qrySubPrint with criteria set to [frmMain]![TagNumber]

My Problem:
everything works beautifully, with one exception: (rptSub) won't appear on my printout. now in design view, it appears fine, and all records pull from their sources, but print & print preview won't show the subform at all. now i've created a print preview button on frmMain that prints only one record of rptMain (because of the query criteria) that contains the following code:

Dim stDocName As String
stDocName = "RPT_ Function_Test_Printout"
DoCmd.OpenReport stDocName, acPreview

now, i'm guessing i should either add a line of code to the button, or add an OnOpen expression to the subform, i just don't know what code to add.

I would greatly appreciate any suggestions or advice.
 
I don't quite get why you have 2 critieria fields on 2 different forms....the Sub and Main reports should be linked by related data, the main report should be the one controlled by form criteria and the sub will return data related to the records returned by the main.

Coding does not sound like your issue, it's the linking and the criteria.
 

Users who are viewing this thread

Back
Top Bottom