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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Could not delete from specified tables"

Status
Not open for further replies.

rcoutts

Technical User
Sep 5, 2001
60
US
I have a Time Card form where I want to keep records around for 5 weeks or so, but whenever a new weekly time card is submitted, I want to delete any records that are more than 5 weeks older than the one just submitted (so that an employee can review previous expenses, job hours, etc., for the past month or so, even though they don't have the ability to resubmit an old time card.)

So, every time they click the "Submit Current Time Card" button, I run a Query that Appends the weeks changes to a master table. I then want to run this query to delete records in the local table that are more than 35 days old. The table and timestamp for each local record is [JobHours]![WeekEnding]. The time stamp for the last time card submitted is [TimeCard]![WeekEnding]. So my delete query in Design View looks like this:

Code:
   Field: JobHours.*    WeekEnding
   Table: JobHours      JobHours
  Delete: From          Where
Criteria:               <[TimeCard]![WeekEnding]-35
When I run this as a Select Query, I get the list of old records that I want to delete. But when I change the Query to a Delete Query and run it, I get the error &quot;Could not delete from specified tables.&quot; Am I running into a protections thing? When I view the table I want to modify in a form, I can delete records no problem. Also, when I run my Delete Query from a form, I get the same error.

Thanks in advance.
Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top