Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Preventing Duplicates in a Table

Results 1 to 6 of 6
Share This Thread →
  1. #1
    tcsikany is offline Contributing User
    Join Date
    Jul 2008
    Posts
    86
    Rep Power
    6

    Preventing Duplicates in a Table

    I have a table that associates Employees (from the Employee table) with Protocols (from the Protocol table)

    I would like to make it so you can't associate the employee to a protocol that has already been made. The table is currently Many to Many

    My table columns are:

    strDocNum
    intEmpID
    dtmDateCompleted

    Can anyone help?

    Tina

  2. #2
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    How do you fill data into this table? When a protocol is created? One simple method is use a combobox who's record source is query that pulls only the protocols you want to make availble to a specific employee. It's easier to limit the users choices than it will be to try and limit the combination of foreign keys in your table records.

  3. #3
    tcsikany is offline Contributing User
    Join Date
    Jul 2008
    Posts
    86
    Rep Power
    6
    Hi. The two fields are look up fields. On the form used for entry, the information in the Employee table is the Parent and a subform for the protocols is the Child form. It filters the list of documents and displays only the ones completed by the employee in a table grid where new records can be added. This is where I'd like to prevent a duplicate entry.

    Does this help?

  4. #4
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    Is there a limited number of protocols? or can the list be infinite? It would be difficult to limit what the user can enter into the datasheet view. You may want to prevent entries directly into the grid view, but instead provide a seperate form for entry where you can control the available choices.

  5. #5
    tcsikany is offline Contributing User
    Join Date
    Jul 2008
    Posts
    86
    Rep Power
    6
    The protocols list is infinite. New ones are being added as they are developed.

  6. #6
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    Quote Originally Posted by tcsikany View Post
    The protocols list is infinite. New ones are being added as they are developed.
    Are the protocols added to the database seperately, before the current operation. What i'm getting at is an unmatched query. that would list all the available protocols that do not match the current list associated with the currently selected employee. That query could be used as a record source for a combo box to be used to match the protocol with the employee. This would essentially elimate duplicate protocols going to the same employee.
    Again, this couldn't be done in the datasheet view you're working with, you'd have to create a seperate form for this.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Getting Duplicates Rows From One Table
    By TheVBPerp in forum SQL Development
    Replies: 1
    Last Post: December 30th, 2010, 12:26 AM
  2. Check for duplicates in table?
    By alphatester in forum ASP Development
    Replies: 1
    Last Post: June 24th, 2010, 03:31 AM
  3. Preventing duplicates in a form
    By ausjoe in forum Microsoft Access Help
    Replies: 3
    Last Post: May 30th, 2007, 07:31 AM
  4. Removing Duplicates from a table
    By LeapingLizard in forum Microsoft Access Help
    Replies: 9
    Last Post: August 26th, 2004, 03:00 PM
  5. Checking for duplicates in table
    By kofseattle in forum ASP Development
    Replies: 3
    Last Post: May 11th, 2004, 01:21 PM

ASP Free Advertisers and Affiliates