Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete query not working, but why?? 2

Status
Not open for further replies.

ttellis

Technical User
Aug 31, 2004
26
US
Let me start by saying that I am new to Access and prior to this current project, have only developed database for school. My knowledge of coding is basic. Here's the problem:

I've been handed to task of creating a database that holds security badge info. BadgeData is the active badge data, but once an employee is terminated, I need to have the data moved to Termed table and deleted from BadgeData. The delete query selects the CardNum from the form IndivData and previews the correct record, but does not delete it. The message I received is: "Could not delete from specified tables. (Error 3086)". HELP says the error means the database was opened in Read-only or that I don't have permission to modify the table. Neither of these are true.

Here is the SQL for the query:
Code:
DELETE BadgeData.*, TempTermed.CardNum
FROM TempTermed INNER JOIN BadgeData ON TempTermed.CardNum = BadgeData.CardNum;

Any help that can be provided would be great!I'm all ears...[bigears]

[smile]Tiffany[smile]
 
JonFer,
The PK in BadgeData is CardNum, but no PK exists in Termed. Since the badges are recycled, the Termed table will have to hold duplicate records with the same CardNum value.

[smile]Tiffany[smile]
 
Thank you John!!! I've taken your suggestions and wnet back in and made some modifications. It's now working like a charm!!

[thumbsup]
 
John,

I was having a similar problem with one of my delete queries, and you post helped me find the error (I had accidentally removed my unique index).

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top