DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: I need to enter more than one entry for pay number

  1. #1
    Join Date
    Mar 2008
    Posts
    1

    Question I need to enter more than one entry for pay number

    History:

    I prepared a database and in it i nominated the payroll number as the primary key. I have 4 tables -

    generic information - Date, payroll number, name, manager, supervisor

    2nd table - auto number, Pay number, L1-I, L2-I, L3-I, L4-I
    3rd table - auto number, Pay number, L1-T, L2-T, L3-T, L4-T
    4th table - auto number, Pay Number, L1-P,L2-P, L3-P, L4-P

    I have done separate reports for each which inclued the generic infor and the "L's" from the relevant reports (not including the auto no or pay no from table 2,3,4)

    I then did a form which has all the above information for personnel to complete,however when it come to entering two reports for the same personnel ie 1234 & 1234 (payroll number) it come up with the below error

    The problem is when I click on a name in the Data list
    I get the error "The change you requested to the table were
    not successful because they would create duplicate values in the index, primarykey,
    or relationship. Change the data in the field that contain duplicate data,
    remove the index or redefine the index to permit duplicate entries.[/HTML

    please help

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX

    What kind of database?

    The error seems pretty straightforward. You can't have duplicates. This is a restriction that is placed when the table is created by the person doing the creation (which I'm guessing is you).

    So, either remove that restriction so that duplicates can be entered or error trap the error and produce a message box telling the user the entry already exists and duplicates aren't allowed.

  3. #3
    Join Date
    Apr 2008
    Posts
    28
    from suej68:
    I prepared a database and in it i nominated the payroll number as the primary key.

    entering two reports for the same personnel ie 1234 & 1234 (payroll number) it come up with the below error << there's your problem

    since your primary key is the payroll number, you can't have 2 or more records for him. what you should do is change your primary key (use the autonumber field instead)

  4. #4
    Join Date
    Jul 2007
    Posts
    161
    Do you have code that creates a record in tables 2 through 4 if the record does not exist?

Similar Threads

  1. Replies: 18
    Last Post: 12-13-2006, 03:49 PM
  2. Prime number program to make go faster
    By divagoddess in forum C++
    Replies: 12
    Last Post: 05-07-2006, 10:55 PM
  3. Replies: 2
    Last Post: 06-30-2005, 06:22 AM
  4. OVERSEAS Online Data Entry Information
    By jai in forum Careers
    Replies: 0
    Last Post: 02-21-2003, 12:43 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center