Adding a second table makes my report print 2x of the same page? (1 Viewer)

john141

New member
Local time
Today, 23:12
Joined
Nov 19, 2021
Messages
7
Hi, hopefully this makes sense. Just a bit confused as to why this is happening. I have a query in which has just one table.

1637668282734.png


It produces the following report which i print as a label (1 A4 page). Note in the bottom left it is printing just 1 page.


1637670520916.png


However, i want to add another table to my query like the below.

1637670682297.png


The issue with this, is without even adding any other fields or anything the label above prints 2 pages. It now says this report is 2 pages and both pages are the EXACT same label with no differences. Why would adding another table duplicate my label onto a second page. Any idea how i can get this back to 1 page whilst keeping the table?
 

Attachments

  • 1637668490183.png
    1637668490183.png
    34.4 KB · Views: 331
  • 1637670449541.png
    1637670449541.png
    34.9 KB · Views: 325

Gasman

Enthusiastic Amateur
Local time
Today, 23:12
Joined
Sep 21, 2011
Messages
14,048
Group By or Distinct in the query ?
 

john141

New member
Local time
Today, 23:12
Joined
Nov 19, 2021
Messages
7
Group By or Distinct in the query ?

Ahh i am using SELECT DISTINCTROW [QryStock].[product] FROM [QryStock];

could this be the issue?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:12
Joined
May 7, 2009
Messages
19,169
try removing DISTINCTROW from your query.
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:12
Joined
Sep 21, 2011
Messages
14,048
Well if the rows differ?
 

john141

New member
Local time
Today, 23:12
Joined
Nov 19, 2021
Messages
7
Well if the rows differ?

The rows used for this report are the exact same. I just want to access the query on a different report which uses the second table. The report in question doesn't reference the second table or any fields from it
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:12
Joined
May 7, 2009
Messages
19,169
just use 1 table?
the other table is Joined but is useless since it does not output anything to the report.
 

john141

New member
Local time
Today, 23:12
Joined
Nov 19, 2021
Messages
7
just use 1 table?
the other table is Joined but is useless since it does not output anything to the report.
The second table is used to output to a separate report. Just not the report in question.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 18:12
Joined
Feb 28, 2001
Messages
27,001
If these reports are commonly used and the queries are not dynamically created, build two queries, one for each report.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:12
Joined
Feb 19, 2002
Messages
42,977
The reason the row count increased is because of the way joins work. There appears to be more than one row in the second table for each of the rows in the first table. Let's take a simple example. Parents, children. For any parent that has more than one child, there will be a row returned for each child. So your original query returned one address label for the letter you were sending to parents but by joining to the children table, you have changed the query to return one row for each child so you end up with multiple rows per parent.

Sometimes we have to include a many-side table in a query but we just want a total or we just want the record ot occur if ANY row exists in the many side table.

You are going to need to tell us why you added the second table to the query so we understand how to solve your problem.
 

Users who are viewing this thread

Top Bottom