• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1771
  • Last Modified:

Run-time error 3167: Record is deleted

I have a user receiving a message that I don't get. They get run-time error 3167: Record is deleted. It happens when clicking on a button that is to delete a record from a table that is part of the query for the form.

Here's the code:

CurrentDb.Execute "DELETE * FROM Header WHERE AssessmentID=" & Me.AssessmentID
Me.Form.Requery

Is this caused because of the requery? Maybe the form doesn't know the record has been deleted.
0
Dale Logan
Asked:
Dale Logan
  • 3
1 Solution
 
plummetCommented:
Hi

What is the form's recordsource at the time of the delete?

0
 
Dale LoganConsultantAuthor Commented:
It's a query having about 7 tables. Table Header is one of those tables.
0
 
Dale LoganConsultantAuthor Commented:
Figured this out myself. I needed to move the focus to another record before performing the requery.
0
 
Dale LoganConsultantAuthor Commented:
This question must have slipped through the EE cracks. I had never received a notice saying it was still open. I figured this one out a long time ago.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now