If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Report Assistance - Fields from different tables with no relationship

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 72
Report Assistance - Fields from different tables with no relationship

Hey guys and gals,

I have multiple tables with absolutely no relationship to each other. They record completely different things, therefore I wouldn't think a relationship is needed whatsoever. The primary key is an ID autonumber on all of the tables.

I'm trying to create a report that will sum one field from each table. I've tried creating a query with a field from each table, for the recordsource. When I run the query however, it lists the same information multiple times. It seems to do this because there aren't the same number of records in each table, so it seems to fill the gaps by just duplicating information.

I'm not sure how to create the query so that I can use it as the record source for my report.

Any thoughts?
__________________
Version: Access 2010
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 1,177
What you're getting is correct and normal.

In your report, use the master table for header info (e.g. customer name) and the detail table for the detail info (e.g. orders table). Access knows not to repeat the header info.

Caution, however; if you have more than one detail table, such as PO as master, and invoice and PO changes as two completely separate detail tables reporting to PO, you will need to use sub-reports instead of a simple layout.

Sam
Reply With Quote
  #3 (permalink)  
Old
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,275
Quote:
Originally Posted by Pis7ftw View Post
Hey guys and gals,

When I run the query however, it lists the same information multiple times. It seems to do this because there aren't the same number of records in each table, so it seems to fill the gaps by just duplicating information.

I'm not sure how to create the query so that I can use it as the record source for my report.

Any thoughts?
Check how you are grouping your data and sumiing it
not see the query I think you are grouping the ID just take the First or last one and sum the Numbers you want to total.
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
VB based on my own environment: vb6 sp5
ASP based on my own environment: 5.6
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
MYLE
Reply With Quote
  #4 (permalink)  
Old
Grand Poobah
 
Join Date: May 2003
Location: Dallas
Posts: 779
Also if some of the results are giving you multiple or repeat rows of data that you only need to see once - change the join type
example
select table1.* from table1
INNER JOIN table2 ON table1.ID = table2.id

this shows where both sides ID are equal - possibly giving multiple or repeat records but if you change it to

select table1.* from table1
Left JOIN table2 ON table1.ID = table2.id

you would only get all the rows from table1 and related data from table2 that is relevant to table1 not repeating rcords where both sides are equal.

This may help you recordsource of the report.
__________________
Dale Houston, TX
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On