Results 1 to 6 of 6

Thread: Display/print Report with two tables

  1. #1
    geraldk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    42

    Display/print Report with two tables

    Hello,

    I am trying to print out a report in Access 2010 (32bit). I am pulling data from two tables. One of the tables is Employee Information(Name, address, phone) the other table is Employee Vehicle(has multiple values, each employee will have many vehilces (one to many)) What I am after is displaying one employee with their vehicles. I have tried in creating a query for this, and the I get:

    Employee A - GMC Truck, Dodge Dart

    result

    Employee A, 212 Main Street, Town, City, GMC Truck
    Employee A, 212 Main Street, Town, City, Dodge Dart
    Employee B, 100 Yonge Strreet, Town, City, Grand Am

    Then I tried, create a report with the query to get the information for the employee information then insert list box for the vehicles. But this will display all vehicle information for all employees and not for just that one.
    Click image for larger version. 

Name:	Two Tables.JPG 
Views:	3 
Size:	45.2 KB 
ID:	8630Click image for larger version. 

Name:	Report.JPG 
Views:	4 
Size:	40.4 KB 
ID:	8631

    I have attached the tables that I trying to get the reports from and a sample of the report I trying to print.

  2. #2
    ssanfu is online now VIP
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    2,034
    You might try using a sub-report.

    Remove "tblEmpVehicle" from the query.
    Create a query from the table "tblEmpVehicle" ("qryVehicle")
    Create a report using "qryVehicle" ("srVehicle") ** sr = subreport**
    Use "srVehicle" as a sub report on your main report.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  3. #3
    geraldk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    42
    Thanks for the reply.

    Okay creating the subreport worked. The only thing is it's popping up Enter Parameter Value for the query from Employee information. When I return a blank value in the message box all the information is needed. This report is fine for me to bypass I would like the message to not come for the end user.

    Any thoughts on this?

  4. #4
    ssanfu is online now VIP
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    2,034
    One of the queries has a parameter. If the query for the sub-report has a parameter, it is not needed. The link between the employee (form) and the vehicle (sub-report) is set in the report/sub-report control properties.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  5. #5
    geraldk is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    42
    Found it. It was between the subform and the report.

    Thank you for your help.

  6. #6
    ssanfu is online now VIP
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    2,034
    Excellent!!
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

Similar Threads

  1. Replies: 2
    Last Post: 05-06-2012, 10:10 AM
  2. Replies: 1
    Last Post: 03-26-2012, 02:01 PM
  3. Replies: 9
    Last Post: 02-22-2012, 05:30 PM
  4. Replies: 0
    Last Post: 02-22-2011, 03:04 AM
  5. Report control of a field display/no display
    By systems013 in forum Reports
    Replies: 5
    Last Post: 02-01-2010, 07:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums