473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Create a report with sub reports related to two independant tables

41
Hello,

I have turned around this problem but because of my little knowledge of Access, I did not find any solution. So I am posting once again my request in the forum (that really helped me so far!) with the hope to find a solution.

I have two tables: Table1 and Table2.

Both tables are independent. However, they share one common field: [Client Name]. Key Field is AutoNumber.

The tables record the excesses of customers over their current account.

There are two types of excesses: Overdrafts & Irregulars.

Table1 records Overdrafts.
Table2 records Irregulars.

Customers can have Overdraft only, Irregulars only or both.

The excesses can either be reviewed or not (a check box is to be ticked if the excess has been reviewed). One query for each table filters the same.

The customers are identified through the field [Client Name], which is the same for both tables.

I want to create a report that lists me, for one particular customer, the list of Overdraft and Irregulars that have not been reviewed.

I thought about creating sub-reports but it did not work as I wanted. The main problem being that I don’t know how to retrieve the companies that appears either in Table1 or Table2 or both. I thought about doing some filtering but the problem is that it does not give me a list but two columns, with a duplication of data. Maybe the ideal would be first of all to create a list with all the companies that appear either in Table1 or in Table2 or both, get rid of the duplicates and then use this list to create the report, with sub report being linked to this main field.

I apologise if I am a bit confusing but it is not even clear to me on how to proceed. So, should you have any questions, I would be more pleased than answer you back.

I have almost finished my database and this is one of the last steps to go !

Thank you very much for your help.

Best regards,

G.
Jan 14 '07 #1
4 2096
nico5038
3,080 Expert 2GB
You should have one table tblCustomers with a CustomerID, CustomerName, etc.
This to make sure you'll see the total set of customers. Now you can have a customer in table1, table2 or both tables.
To create a complete tblCustomer you can use:
select customername from table1
UNION
select customername from table2;
SAve the above query and change it into a MakeTable query.

This table can be JOINed to table1 and table2 in a query with a so-called "outer join". To create the outer join place all three tables and connect them by the CustomerName using drag and drop. Next doubleclick the connectionline and make the tblCustomer "leading" by chosing option 2 or 3.
This query will show all customers with the field(s) you need from table1 and 2

Getting the idea ?

Nic;o)
Jan 14 '07 #2
NeoPa
32,556 Expert Mod 16PB
Assuming that, being a bank, you actually PK the accounts on the Name field. Not the best idea generally, but as in this case you are certain that it's unique, you can get away with it.
To create your list you will need to select the required client somehow - I will assume that you will do it with a prompted parameter in the query unless / until told otherwise. {Other Common Details} refers to other common fields that you want to show from both tables. You say you have none but I fail to see the use of a query simply showing the Client Name over and over again. I suspect you've missed out some info maybe.
Expand|Select|Wrap|Line Numbers
  1. SELECT [Client Name],{Other common Details}
  2. FROM [Table1]
  3. WHERE ([Client Name]=[Select Client Name])
  4. UNION ALL SELECT [Client Name],{Other common Details}
  5. FROM [Table2]
  6. WHERE ([Client Name]=[Select Client Name])
Nico's solution includes the table that holds your client information. It's hard to think that you could want a report without this information, so look at his solution, but if you're certain you do, this should do it for you.
At the end of the day, we can only respond to the question as asked with the info provided.
Jan 14 '07 #3
Gari
41
Dear both,

Merging two tables in one using UNION solved my problem and I could design the report I wanted.

Thank you very much for this tip. It is very useful and I might use it more often !

Best regards,

G.
Jan 15 '07 #4
nico5038
3,080 Expert 2GB
Glad we could help Gary and success with your application !

Nic;o)
Jan 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: BlackFireNova | last post by:
Using Access 2002 I am writing a report which draws data from several different tables. I can't link all the tables in a query, as some can not be related without truncating the data. I plan...
1
by: intl04 | last post by:
I am getting strange print-related error messages when trying to create (not print!) reports. For example, when I click 'new' to create a report then choose 'design view', I get an error message...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: jason | last post by:
Hello, Does anyone have any experience with 3rd Party Crystal Report viewers? I'm looking for a viewer that allows me to view reports in our web app without having crystal reports installed on the...
2
by: Tom | last post by:
This is related to an earlier post entitled "Text in Query/Numbers in Report" Brief recap - report has a query as a record source. The query shows the correct data, the report translating the...
0
by: Rahul Chatterjee | last post by:
Hello All I have designed a dotnet application using VB which basically takes a selection and passes value to a crystal report which in turn passes the value to a Stored procedure. After the...
0
by: Madhu Subramanya | last post by:
I have a Crystal Report 10 report which i need to use in my app. I use Managed solution for this. There are no compiler or linker problems. I am not able to display this report on the screen but am...
0
by: Peter Herath | last post by:
I want to create a custormizable report . For an example, there's a form with four combo boxes and two of them having database tables columns/field names as values in the combo box(one for select row...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.