No duplicates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dawn
    New Member
    • Sep 2006
    • 3

    No duplicates

    I have a parent table, a join and another parent. Not sure this is right.

    first parent is a Products table, the second parent is a projects table. Then there is the join table.

    tblProductProje ctJoin has
    ProductProjectJ oin - PK
    ProjectID - FK
    ProductID FK
    qty

    tblProject has
    ProjectID - PK
    ProjectName - FK

    I have created a form - frmProject with the fields ProjectID and ProjectName. Inside this form is a subform that displays concatendated fields of the products and qty.

    Object: I would like to add products Project A. (all is fine when I do this)

    Problem 1: 1st of all, I don't want Project A to be able to be used twice. How can I prevent this in the form? So if a user says, they need to add items to a project, I would like to restrict them from adding 2 Project A's.

    Problem 2: Why is it that when I do add two Project A (with different or the same products) the tblProject gets a record added to it. So tblProject started with Project A, B, C and if Project A gets added again to the frmProject, then the tblProject now has A, B, C, A in it. Duplication is happening on my parent table.

    Thank you for any and all assistance.
    Dawn
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    So a precision question? You don't want that Project A is added twice in your main form or you want that there is only one row in your subform?

    If this is the first case so put a primary key or Index with no Duplicates on your Project Name!

    :)

    In the second case set primary key or index without dublicates in tblProductProje ctJoin

    :)

    Originally posted by Dawn
    I have a parent table, a join and another parent. Not sure this is right.

    first parent is a Products table, the second parent is a projects table. Then there is the join table.

    tblProductProje ctJoin has
    ProductProjectJ oin - PK
    ProjectID - FK
    ProductID FK
    qty

    tblProject has
    ProjectID - PK
    ProjectName - FK

    I have created a form - frmProject with the fields ProjectID and ProjectName. Inside this form is a subform that displays concatendated fields of the products and qty.

    Object: I would like to add products Project A. (all is fine when I do this)

    Problem 1: 1st of all, I don't want Project A to be able to be used twice. How can I prevent this in the form? So if a user says, they need to add items to a project, I would like to restrict them from adding 2 Project A's.

    Problem 2: Why is it that when I do add two Project A (with different or the same products) the tblProject gets a record added to it. So tblProject started with Project A, B, C and if Project A gets added again to the frmProject, then the tblProject now has A, B, C, A in it. Duplication is happening on my parent table.

    Thank you for any and all assistance.
    Dawn

    Comment

    • Dawn
      New Member
      • Sep 2006
      • 3

      #3
      Originally posted by PEB
      Hi,

      So a precision question? You don't want that Project A is added twice in your main form or you want that there is only one row in your subform?

      If this is the first case so put a primary key or Index with no Duplicates on your Project Name!

      :)

      In the second case set primary key or index without dublicates in tblProductProje ctJoin

      :)
      Thank you. I figureed this out (the way you said) and it works. Thank you for your time.
      Dawn

      Comment

      Working...