-
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
-
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.
-
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)
-
Do you have code that creates a record in tables 2 through 4 if the record does not exist?
Similar Threads
-
Replies: 18
Last Post: 12-13-2006, 03:49 PM
-
By divagoddess in forum C++
Replies: 12
Last Post: 05-07-2006, 10:55 PM
-
By ortizsr in forum VB Classic
Replies: 2
Last Post: 06-30-2005, 06:22 AM
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|