Results 1 to 5 of 5

Thread: Access Report/Query

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34

    Red face

    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.

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Talking

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34
    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?

  4. #4
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196
    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.

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width