By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

Key Violations

P: 10
i am creating a database for organising training courses and logging staff attendance.

Tables:
1. TrainingSessions(primary keys: POPCode, ModuleCode, Section, SessionCode)
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)
3. StaffList table (primary keys: StaffCode & Team).

The relationships are:

many to one form 1 to 2 across the SessionCode field.
many to one from 3 to 2 across both StaffCode & Team

I created an append query to enter records for all staff members on a particular team to the attendance table (each course is run per a team). This is taking SessionCode from TrainingSessions and StaffCode and Team from the StaffList table.
In dataview the query is selecting the records i need but access gives me a key violation error which i dont understand..

Any help is appreciated!
Oct 5 '06 #1
Share this Question
Share on Google+
2 Replies


PEB
Expert 100+
P: 1,418
PEB
Hi,

In fact what is the primary key for the table
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)

Only SessionCode?

In the indexed property what is indicated for the field SessionCode?

It should be Yes dublicates!

:)

i am creating a database for organising training courses and logging staff attendance.

Tables:
1. TrainingSessions(primary keys: POPCode, ModuleCode, Section, SessionCode)
2. TrainingSessionAttendance(primary code: SessionCode, Team, StaffCode)
3. StaffList table (primary keys: StaffCode & Team).

The relationships are:

many to one form 1 to 2 across the SessionCode field.
many to one from 3 to 2 across both StaffCode & Team

I created an append query to enter records for all staff members on a particular team to the attendance table (each course is run per a team). This is taking SessionCode from TrainingSessions and StaffCode and Team from the StaffList table.
In dataview the query is selecting the records i need but access gives me a key violation error which i dont understand..

Any help is appreciated!
Oct 8 '06 #2

P: 10
I have set all 3 listed fields in tblTrainingSessionAttendance as the Primary Key and the index on all of them is, as you say, set to duplicates ok. The 3 fields combined will create a unique key for each staff member attending a particular course. I dont understand where the conflict is arising from.
Thanks,
Aidan
Oct 9 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.