Results 1 to 9 of 9
  1. #1
    Surferboy1500 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    9

    Report that Pulls from two Forms - Lending Library


    Hello,

    I'm using the lending library template to make a lending library.

    My particular library will require users to donate (be the original owner) before they can check-out assets.

    Can someone explain to me or link an explanation that shows me how to make a report that pulls information by user with both 1) the assets from the "original donor" and 2) any assets that are checked-out to that user.

    I'm trying to take the donated assets less the check-out assets to come up with how many net assets donated or check-out.

    I've attached the database here. Any help would be greatly appreciated. Thanks!
    Last edited by Surferboy1500; 06-06-2011 at 07:53 PM.

  2. #2
    Surferboy1500 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    9
    Saturday bump

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Use a UNION query to start with (name it like DonationsAndOut). This will get records from both tables into common columns. Then use this query as the basis for subsequent manipulations of data. Join it to the Contacts table to get contact info (names) and Assets table to get Asset details. Build a report with grouping and sorting and summary calcs.
    SELECT "Donation" As Category, ID As AssetID, Owner As UserID FROM Assets
    UNION SELECT "Out", Asset, [Checked Out To] FROM Transactions WHERE [Checked In Date] Is Null;

    There is no wizard or designer for UNION query. Must type in the SQL View editor. Open the query designer then select SQL View from from the ribbon.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Surferboy1500 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    9
    When I make the SQL query above and then try to make a report, it says that the tables/queries are not connected. I used relationships to connect AssetID to ID on the assets table and UserID to ID in the Contacts table but it still gives me this error message. I'm hoping to present this report tomorrow, so any help would be GREATLY appreciated. Thanks in advance.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    I am not familiar with that error message. I know join with UNION query is possible, I do that. Post the report's RecordSource SQL statement for analysis. It should be like:
    SELECT DonationsAndOut.UserID, [Last Name] & ", " & [First Name] As MemberName, AssetID, Coral, Category
    FROM Assets RIGHT JOIN (Contacts RIGHT JOIN DonationsAndOut ON Contacts.ID = DonationsAndOut.UserID) ON Assets.ID = DonationsAndOut.AssetID;

    Include as many fields as desired from Assets and Contacts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Attached is the Lending Library db with the two queries I described. I will remove it after you respond or in a few days.

    EDIT: Purpose served, file removed.
    Last edited by June7; 06-07-2011 at 11:31 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Surferboy1500 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    9

    Thanks

    I've pulled the DB and will open it at work today. You can remove it though. Thanks,
    Josh

    Edit: I've opened it up. Hopefully my last question. I used your join to add a bunch of fields and make the report and it worked!

    Is there a way to add donations and subtract the "out" assets? I was thinking if there is a way to sumif on that field, I could get two sumif's and then subtract one field from the other. Or do you know an easier way to do that to get a count total? Thanks again, you've bee a huge help.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Attached is an extract of the Lending Library with a report I built to demonstrate what you ask for. Showing is easier than describing. Will remove after you respond or in a few days.

    EDIT: Purpose served, file removed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Surferboy1500 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    9
    THANKS SO MUCH! And with that this thread has been solved!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Check Outs - Lending Library
    By Surferboy1500 in forum Access
    Replies: 4
    Last Post: 04-15-2012, 08:44 AM
  2. Check Out - Lending Library
    By Surferboy1500 in forum Access
    Replies: 2
    Last Post: 05-30-2011, 09:05 AM
  3. Lending library template
    By Viking in forum Access
    Replies: 5
    Last Post: 11-16-2010, 06:19 AM
  4. Replies: 2
    Last Post: 05-24-2010, 06:47 PM
  5. Replies: 1
    Last Post: 02-13-2010, 12:44 PM

Posting Permissions

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