Results 1 to 7 of 7
  1. #1
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181

    duplicate data

    I have 2 tables, one for staff info and one for researcher info. Staff and researchers can be issued desk space in rooms that are available. is there a way to check that the desk has already been allocated? Can the check be made across the 2 tables?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Seems you would also have a Desk table.
    And some logic to assign/unassign Staff/Researcher to a Desk.
    You can determine if a desk is available or not by checking whether it has been assigned.

    Could possibly use a form and the technique shown in this free video.

    Good luck.

  3. #3
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    Quote Originally Posted by orange View Post
    Seems you would also have a Desk table.
    And some logic to assign/unassign Staff/Researcher to a Desk.
    You can determine if a desk is available or not by checking whether it has been assigned.

    Could possibly use a form and the technique shown in this free video.

    Good luck.
    I do have a desk table also. I have created a unique key in this table to ensure the desk is not duplicated in the table when a new desk is being added to the database. The problem then is how do i check that the desk has not been allocated. The easiest way i guess would be to combine the staff and researcher tables. The problem here is the fields in both tables are different.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Use a union query:
    "SELECT StaffID As ID,'Staff' As TableSource, DeskId as Desk FROM tblStaff
    UNION ALL
    SELECT ResearcherID as ID,'Researcher' As TableSource, DeskID as Desk FROM tblResearcher;"

    Cheers,
    Vlad

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    In the desk table you could include a field "IsAssignedTo" and when a Desk is assigned, you could put the ID of the Staff or Researcher. When that desk is unassigned, you remove the ID.

    In general to see which desks are unassigned at any time, you would run a query

    Code:
    Select * from tblDesk where IsAssignedTo Is Null

  6. #6
    Join Date
    Apr 2017
    Posts
    1,679
    OP's problem is, that for registering staff and researchers are different tables. So some staff member can have same ID as some researcher, as both tables are independent. When e.g. in desks table is field AssignedTo, which contains either staff or researcher ID, then there is no way to say, which of them. Either there must be an additional field determining from which table the ID value originates, or ID's in both registry tables must be distinguished somehow (e.g. all staff ID's start with "S" and all researches ID's start with "R", or OP must have an additional table, where all ID's from both tables are collected and some genereal ID (probably autonumeric) is created, or OP has to redesign the database so, that staff and researchers are registered in same table. Probably having common fields in this table, and fields filled for one group only either in same table too (which results in lot of empty fields for rows from same group), or in separate table(s) with same ID value for mathcing row in main registry table.
    Last edited by ArviLaanemets; 06-23-2018 at 12:34 AM.

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    That is why I suggested using Union ALL and adding the source table field ("Staff" and "Researcher").
    Cheers,
    Vlad

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

Similar Threads

  1. Combine Duplicate Data?
    By RGatDP in forum Access
    Replies: 2
    Last Post: 05-24-2016, 01:16 PM
  2. How to prevent duplicate data
    By ariansman in forum Forms
    Replies: 2
    Last Post: 08-11-2015, 06:25 AM
  3. Duplicate data on a query
    By arronaf in forum Queries
    Replies: 6
    Last Post: 12-01-2014, 11:13 AM
  4. Duplicate data message for a data entry form
    By JulieMarie in forum Access
    Replies: 5
    Last Post: 07-30-2013, 08:18 AM
  5. Replies: 3
    Last Post: 03-01-2013, 12:41 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