Results 1 to 3 of 3
  1. #1
    Rjack is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    1

    How to link items accross tables with duplicates/potentially more complicated

    Hi,

    Just to give some background - I have 3 tables.

    Each of these tables refer to a process of a serial number moving throughout a business.

    Tables comprise of, "Out" which is an item going to a supplier. "Returned" which is coming back, and "final" which is to the customer.

    Now, i link these all together using serial, and include all from first table and linking to the other two.

    That means that every transaction has the 'going out' and when matching, what goes on next.

    Now the problem is, if the same serial gets processed as 'going out' once again. This will start linking previous date orders and duplicating the results.

    If it was a case of twice, it could just use an iif and display only where dates are greater than previous, but if a third happens i can't figure out a solution.

    Someone has suggested to create two extra tables combining this information -

    One 'archive' where items have 'finished' and not referencing to that agin

    and another 'live' which will have items not yet returned.

    Which makes sense, but I'm not sure how i would make that switch, as i assume i'll need to run 'first' iterations of everything with results, but then delete that same data from the source tables?

    Either way, i'm a bit stumped.



    If anyone is able to help at all, i'd be supremely grateful.

    Thanks!

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,469
    You can't use serial as the key to the records if it is not unique in the table. Do you have to keep a record history on when it changed from Out to Returned to Final? Sounds like maybe you need:

    tblSerial (SerialNbr(PK), other fields)
    tblSerialProcess(ProcessID(autonumber), SerialNbr(FK combobox from tblSerial) Status(Out, Returned, Final), StatusChangeDT(datetime)

    You can then filter out records that have Final as status in your query. Also if you have to send out the item again, use a new record (select same Serial).

  3. #3
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    well you can't rely on just the serial# - you need a unique ID for the overall transaction (Out, Return, Final) that ties the 3 together uniquely.

    having said that - I'll warn you that you're design is problematic in my opinion. Those 3 tables should be 1 table (the transaction table) and there should be Status field for: Out, Return, Final;

    then you need look up tables for your products/serials, customers, suppliers.

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

Similar Threads

  1. Complicated Query Showing Duplicates
    By lzook88 in forum Queries
    Replies: 1
    Last Post: 09-24-2016, 03:20 PM
  2. Replies: 3
    Last Post: 03-08-2016, 03:32 PM
  3. Displaying data if potentially null
    By mpreston14 in forum Queries
    Replies: 5
    Last Post: 10-07-2013, 10:44 AM
  4. Report items link to form
    By pinky33 in forum Reports
    Replies: 2
    Last Post: 04-25-2012, 11:23 AM
  5. Find Duplicates Query - Excluding Items
    By Wahnsinn in forum Queries
    Replies: 1
    Last Post: 11-17-2011, 07:27 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
  •  
Other Forums: Microsoft Office Forums