PDA

Click to See Complete Forum and Search --> : Access Report/Query


damarious
Sep 18th, 2000, 11:04 AM
OK, I should be able to do this, but I can't...

I need to design a report that takes a customer number from a form and returns query results from three tables. I can get a report to show data from one table by making the record source a query that pulls from one of the tables, but I need to query three tables on the same report.

I'd really appreciate somebody talking me through this one. Thanks.

DrewDog_21
Sep 18th, 2000, 12:01 PM
Design and save a query in Access that defines the
relationships between the three tables. Also, be sure that
the relationships are correctly defined in the Relationships
window. Then for the report's data source, pull the records
from the query itself. Your SQL would look something like:

"Select * From MyQuery Where IdCUSTOMER = " & txtCustomerID

damarious
Sep 18th, 2000, 12:18 PM
OK, I did that and the report and query will only return data if all three tables contain at least one record with said customer number.

Any ideas? Could it possibly be the way my relationships are defined?

RIVES
Sep 18th, 2000, 01:09 PM
Go to the Relationships...Double click on the middle section of the join line between the tables. Click on the join type button and then click the desired join type. Inner Join means that both tables should have the same record id (hope you know what i mean)... left outer join means that all the records from the left table would be return even if it does not have a partner on the right table...right outer join is well, the opposite of left.

Hope this helps.

damarious
Sep 18th, 2000, 01:45 PM
OK, I messed around with all the different types of realtionships, with zero results.

Let me outline my tables, maybe you can let me know what my relationships should be:

C_Info - contains two columns: cnum|cname
Class_A - 4 columns :Cust_Num|IP|Subnet|EntireSubnet(y/n)
Class_B - 4 columns :Cust_Num|IP|Subnet|EntireSubnet(y/n)
Class_C - 4 columns :Cust_Num|IP|Subnet|EntireSubnet(y/n)

I need to query the tables for all IPs with the Cust_Num that matches cnum