I need to delete a record that is open

bobby

Registered User.
Local time
Today, 23:21
Joined
Apr 29, 2004
Messages
28
Guys, i have a form and it loads existing results into a database using an sql query.

THe user selects one of the records that they want to delete. When they click the delete button this code is run:

DELETE *
FROM tblGoals
WHERE ((tblGoals.Player_ID)=(Forms!frmAdd_Home_Goals!lstHomeScorers.value));


However, its saying that it cant delete it because of "key violations, and 0 records due to lock violations".

I think this means that it cant delete it because its currently using it to populate the combo boxes, but im not ocmpletely sure.

Any suggestions?
 
Does the primary key of tblGoals link to another table. If it does and you have referential integrity checked and cascade delete unchecked then you will get a violation because there are foreign key records relating to the PK that you are trying to delete

L
 

Users who are viewing this thread

Back
Top Bottom