Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Inventory Query


    I'm trying to make an inventory database. In this case, weapons are issued out. I need it to show only weapons that are available. Once returned, I need it to show the weapon to be available again. I made a query. But when the weapon is issued again, it still shows up. I'm sure that I over simplified it. I can really use some help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    The weapon record should have a flag, CheckedTo (as long integer)
    when checked out, it should have the persons ID #

    once returned, the field becomes NULL, to show its checked in.

  3. #3
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I was trying to use the issued date and returned date instead of a checked out box. I'm trying to preserve history so we can go back and know who it was issued to.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It would help to know the table structure. With a weapons table and a transactions table, the items in the transaction table where the returned Date is null are out. An unmatched query of those vs the weapons table tells you which are available.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    UT227,

    If you step back a little from your specific problem, I think you will find it very much like a Library System.

    You have a number of Books and a number of Borrowers. You keep info on the Books_Out_on_Loan (Loans and Returns).

    Books ===weapons
    Borrowers
    Books_out_On_Loan=== WeaponsIssued/WeaponTransactions

    as Paul said, Weapons and Transaction tables --you'll probably need a Persons/Borrowers table also.

  6. #6
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Click image for larger version. 

Name:	Not Issued.jpg 
Views:	21 
Size:	112.1 KB 
ID:	25923
    Here's the query. I'm using a tblEquipment and a tblEquipIssued. The rest are drop down lists.

  7. #7
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Yes. I think you're absolutely correct. It is much like a library. Unfortunately, I don't know how those databases are put together either. I'm kinda flying blind. Trying to problem solve. I'm just coming up blank.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Could a record have a null issue date? I wouldn't think so. My suggestion stands though: 1 query to find those that are out, a second to find those that aren't.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    For the purposes of development, I would first make a query that contains only tblEquipmentIssued. There are going to be multiple records on this table for one piece of equipment and you want it to show only one. Get this query right before proceeding to join all the other tables.

    When would IssueDate be Null? Why would a record exist in this situation?

    If equipment is available then there will be no records with ReturnDate = Null. All you need to show is the equipment, you don't need to show the dates.

  10. #10
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    If a piece of equipment is new and never been issued, the IssueDate will be Null. Correct, I don't want to see records with ReturnDate = Null because it should be available. But, because a returned equipment will have a date in the ReturnDate, I put Is Not Null to show returned equipment.

  11. #11
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    pbaldy,
    That sounds like a good solution. I'm going to try it. Yes, an IssueDate can be Null (new equipment, never been issued). Will be trying that.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If I were doing it (and I have done similar things) a new item wouldn't have a record in the transactions table. It's for...transactions.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    That would be my tblEquipmentIssued. How do you keep history, without having a new record in it?

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    There is no transaction until it first goes out in my opinion. You're keeping a record of it being issued before it actually is.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Ah. I understand. No, actually that table is only for in and out. But, I will be trying your suggestion. Will keep you up to date. Thanks.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-05-2014, 11:08 AM
  2. Need help with query - inventory
    By nightangel73 in forum Queries
    Replies: 3
    Last Post: 06-03-2014, 08:53 AM
  3. Replies: 1
    Last Post: 02-21-2013, 12:18 AM
  4. Products Inventory Dilema,Add To Inventory
    By burrina in forum Forms
    Replies: 3
    Last Post: 12-02-2012, 12:10 PM
  5. Query using inventory
    By Porksword in forum Queries
    Replies: 1
    Last Post: 12-02-2011, 06:02 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