Results 1 to 9 of 9
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Inventory Query

    I'm trying to build an inventory database. I have items that will be checked out and returned. I have the inventory based on and issued date and a returned date. I'm having a problem when an item is returned, it will show up as returned. When it is reissued, it's showing twice in my query. This throws my inventory off. Any suggestions?

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

Name:	Query1.jpg 
Views:	21 
Size:	117.7 KB 
ID:	26447Click image for larger version. 

Name:	Query2.jpg 
Views:	23 
Size:	123.3 KB 
ID:	26448
    I had to break up the query into 2 sections

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    First create a query(s) which contains only the primary key of the records that you want shown. Use the Totals feature (icon at the top of the screen) to determine which records, probably using Max. But get this query working first. Then you will use this query to then get the rest of the fields.

  4. #4
    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,870
    Do you have a clear statement -in plain English- of your requirement.

    Employee borrows Equipment
    Equipment falls into/belongs to a Category
    Equipment is associated with an EquipmentType
    Equipment is associated with a Caliber

    I would also suggest a unique composite index on fields
    EquipID + EmployeeID + LoanDate in table EquipmentOnLoan to prevent duplicates.

    Sample model attached.
    Good luck.


    Click image for larger version. 

Name:	EquipmentLoanSampleModel_1.jpg 
Views:	20 
Size:	60.1 KB 
ID:	26450
    Last edited by orange; 11-16-2016 at 10:46 AM. Reason: adjusted model

  5. #5
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Each employee is issued weapons. Upon retirement, being fired, quitting, or for another reason, the weapons must be returned. I have a date the weapon is issued. I also have a date where the weapon is returned. I'm trying to use the return date to show the weapon is no longer issued. I have been able to do this. However, when the same weapon is reissued, the query is showing the returned weapon in the inventory and it's also shown as issued. This messes up my inventory.

  6. #6
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Orange,
    I apologize, but I didn't understand the flow chart or your possible solution. I didn't understand when you put, "I would also suggest a unique composite index on fields
    EquipID + EmployeeID + LoanDate in table EquipmentOnLoan to prevent duplicates."

  7. #7
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Aytee111,
    I can make the query with only the primary keys you like. I'm not sure how this will help with the inventory.

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This first query shows only one IssueID, and with that you can get all the other data that you are trying to show and there won't be any duplicates.

  9. #9
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126

    Lightbulb

    Quote Originally Posted by UT227 View Post
    Click image for larger version. 

Name:	Query1.jpg 
Views:	21 
Size:	117.7 KB 
ID:	26447Click image for larger version. 

Name:	Query2.jpg 
Views:	23 
Size:	123.3 KB 
ID:	26448
    I had to break up the query into 2 sections

    Replace tblEquipmentIssued with a query that selects only the currently issued equipment.


    Jeff

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