Record Duplicates on Report (1 Viewer)

ErinL

Registered User.
Local time
Today, 02:19
Joined
May 20, 2011
Messages
118
Hi everyone -

I was able to find a snippet of code online that did what I wanted (entering blank lines on a report) and was able to adapt it to suit my needs. Here is the code I am using:

Function SetCount(R As Report)
TotCount = 0
R![RowNumber].Visible = True
R![Position].Visible = True
R![Store].Visible = True
R![GreyTotes].Visible = True
R![PlasticPallets].Visible = True
R![PlasticStackers].Visible = True
R![CardboardStackers].Visible = True
R![ChepPallets].Visible = True
R![PecoPallets].Visible = True
R![IGPSPallets].Visible = True
R![WoodPallets].Visible = True
R![SmallBlueTotes].Visible = True
R![Displays].Visible = True
End Function


Function PrintLines(R As Report, TotGrp)
TotCount = TotCount + 1
If TotCount = TotGrp Then
R.NextRecord = False
ElseIf TotCount > TotGrp And TotCount < 5 Then
R.NextRecord = False
R![RowNumber].Visible = False
R![Position].Visible = False
R![Store].Visible = False
R![GreyTotes].Visible = False
R![PlasticPallets].Visible = False
R![PlasticStackers].Visible = False
R![CardboardStackers].Visible = False
R![ChepPallets].Visible = False
R![PecoPallets].Visible = False
R![IGPSPallets].Visible = False
R![WoodPallets].Visible = False
R![SmallBlueTotes].Visible = False
R![Displays].Visible = False
End If
End Function

This works great until the number of records for one row equals 4 or more. Once the number of records hits 4 the last record duplicates on the report. It is only in the table and query once but twice on the report.

I am attaching a screen print of the report as well as a copy of the database for better explanation. The report in question is rptLoadDiagram and the load number would be 36 if you try to run it in print preview.

Can anyone tell me why the last record is duplicating and how to stop it from happening?

Thank you so much!! I appreciate it.

5/1/14:
I have not had any replies to this post but have also not found a solution. In addition, I have discovered another issue. When two lines have the same contents in one of the fields, the second occurrence in not printing on the report. For example, there are two stores in row 3 and both of them have 12 in the grey totes field. It will show 12 for the first store but the second store in blank in the grey totes field. Even though the information is in the table and the missing number is included in the totals it does not print on the report.

I would really appreciate any help with these issues. Thank you in advance.
 

Attachments

  • Load Diagram DB - Copy.mdb
    1.5 MB · Views: 42
  • Duplicate On Report.jpg
    Duplicate On Report.jpg
    30.9 KB · Views: 40
Last edited:

Users who are viewing this thread

Top Bottom