Sub Report Link with Stored Procedures

M

Melody

Hello, I am having a problem with a report and subreport. The main report is
a stored procedure and there are 3 parameters (@EndDate datetime,@ChartID
int,@GroupID int). I provide the values in the "Input Parameter" of the Main
report. For the Sub Report, I have the same three parameters and I place the
values also in the "Input Parameter" of the sub report. The field that I
link the sub report to the main report on is "AcctLogID". The problem is
this link. If I change the control source of the sub report to just a
regular query, the report runs fine but the sub report includes all records
regardless of date. If I try to set the record source (Select ....where
EndDate=" & "'" form_frmCAcctRept.txtEndDate.value & "'") of the sub report,
when the sub report opens for the first time it is fine but then I get a
popup telling me that I can't set the recordsource once the report has
printed. I guess my question is, how can you use stored procedures in the
main report and sub report but keep the proper link? For example, instead of
getting

AcctLogID 3
Detail Records (for AcctLogID 3)
AcctLogID 4
Detail Records (for AcctLogID 4)

I am getting

AcctLogID 3
Detail Records (for AcctLogID 3)
Detail Records (for AcctLogID 4)
AcctLogID 4
Detail Records (for AcctLogID 3)
Detail Records (for AcctLogID 4)

Any help would be VERY appreciated!! I am pretty much at my wit's end!
TGIF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top