Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fields Repeated/ Duplicated in DETAIL SEC

Status
Not open for further replies.

rproactive

Technical User
Oct 6, 2005
65
US
I have tried everything -please help. I have a report based on a query that is duplicating the query results anywhere from 2 to 19 times. It seems to depend on the number of rows of output.

The report has a Report Header, Detail & Page Footer sections.

Code:
Query:
SELECT 
M_FundPaid.FundPaidReceiptSlips_IDs, 
M_FundPaid.FundPaidAmount, 
M_FundPaid.FundPaidTypeFunds_IDs, 
M_FundPaid.FundPaidBanks_IDs, 
M_FundPaid.FundPaidDocumentNumber, 
M_FundPaid.FundPaidAccountNumber
FROM M_FundPaid
WHERE (((M_FundPaid.FundPaidRRs_IDs)=[Forms]![F_DepositSlip]![cboRentRollMonth]) AND ((M_FundPaid.FundPaidRRSub_IDs)=[Forms]![F_DepositSlip]![cboDepositNumber]))
WITH OWNERACCESS OPTION;

Running the query produces correct results.
There is no VBA code behind the report but it is called from an Event on a Form.

Code:
EVENT:
Private Sub cmdPrint_Click()
'*****************************ROGERS SUB03***************************************
On Error GoTo Err_Report_Click
          DoCmd.OpenReport "R_DepositSlip", acNormal
          msgbox "Deposit Slip PRINTED"
Exit_Report_Click:
Err_Report_Click:
End Sub
Suggestions or ideas as to where the duplicates may be coming from greatly appreciated & needed Thanks
 
Are there any subreports involved in this?
What do you get if you add a text box to the report header section with a control source of:
=Count(*)
Is M_FundPaid a table or query? I can't believe your report would return more records than your record source without some code running in the report.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for your ideas-

1. The query is a subreport with no Link Child or Master Fields.
2. count =19
3. M_FundPaid is a table
4. check each Event property on REPORT and no events. Is there any other place to check??
Any other suggestions greatly appreciated.
 
Having a subreport involved is very significant. I expect your main report and subreport have similar records in record sources. Normally your main report should not have the same level of details as your subreport.

If you can't figure this out than come back with record sources of your reports as well as the expressions used to Link Master/Child for your subreport(s).

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
There is no separate sub report listed under Report Objects. My Report R_DepositSlip (whose record sourse is M_DepositSlip) has a single control in Detail Section which is a subform named srC_Q_ReportDepositSlip with following properties:
Source Object: Query.Q_ReportDepositSlip
Link Child Fields: blank
Link Master Fields: blank

Mainform is F_Deposit slip whose record source is M_DepositSlip. It has a subforms.

Perhaps I am confused as to what is a subform?
Again, Thanks for your ideas
 
I think you are confused about forms/subforms or at least reports/subreports.

You should use report objects as subreports on your main reports. A main report normally contains "parent/master" records only. The subreport contains "Child" records. The filtering of the child records in the subreport is tied/synchronized with a record on the main report using the Link Master/Link Child properties. This is much the same as the forms and subforms.

The level of detail should not be the same in the main report and the subreport. For instance a main report might contain Order information while the subreport would contain the Order Details.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Humm. Confused is a good posibility. In fact it’s a certainty at this point. Well I went back to step one and rebuilt entire Report using the wizard & [bold]it worksfine. [/bold]

What happened is still confusing. The original & new report have the following differences:

The new report has a new Group Header section; and no Page Header that the old form had.
The new report is bound to query Q_ReceiptDepositSlip; Old bound to table M_DepositSlip.

The old report had a subreport ; the new report has no subreports. Any comments??

Thanks kindly for pointing me in the correct direction- even though it was to start from scratch. Sometimes that is best instead of looping through the same ground.
 
I don't know why you used a subreport. It sounds like all the records and fields you needed were in the record source of the main report.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top