Results 1 to 4 of 4
  1. #1
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2010
    Posts
    55

    problem with PK and Relatioships in subforms

    i attached a file

    i want to enter many problems to the same phone number,,, but not at the same time
    meaning that i may enter a problem and after a month ago i entered the same number, i want the subform to retrive the old problem

    i tried to make a caller ID as the relatioship but it didn\t work


    i tried to make the phone# as the PK but when i entered the seconed problem an error appeared (The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. (Error 3022))

    how can i solve this problem?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your PhoneNumber (Customer??) has a 1:m relationship with Problems. Customers in one table and Problems in another table with the PK of the Customers table and a FK in the Problems table. Then use a Form/SubForm to display the results with the Cistomer table for the MainForm and the Problems for the SubForm.

  3. #3
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    Your PhoneNumber (Customer??) has a 1:m relationship with Problems. Customers in one table and Problems in another table with the PK of the Customers table and a FK in the Problems table. Then use a Form/SubForm to display the results with the Cistomer table for the MainForm and the Problems for the SubForm.
    yes i already done that
    i mean if the same number after 20 records for example called again , i want when i enter the number to retrieve the problem which is already done but when i need to enter the seconed problem
    this error occurred (The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. (Error 3022))

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your MainForm should have a ComboBox that "Looks up an existing record" instead of a TextBox that is bound to the PK of that table. The cbo wizard know how to create one of these just add the cbo to the form and select Option #3. Use the NotInList event to add a record if it cannot find an existing one.

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

Similar Threads

  1. Subforms
    By fwillia in forum Access
    Replies: 2
    Last Post: 09-24-2010, 08:03 AM
  2. subforms
    By thewabit in forum Forms
    Replies: 6
    Last Post: 02-01-2010, 09:03 PM
  3. Help with subforms
    By chocpoc in forum Forms
    Replies: 0
    Last Post: 05-20-2009, 11:50 PM
  4. SubForms
    By duckie10 in forum Access
    Replies: 4
    Last Post: 05-17-2009, 07:15 PM
  5. Subforms
    By henryclay in forum Access
    Replies: 0
    Last Post: 07-24-2007, 07:51 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