"Record is deleted" on close error

ck4794

Registered User.
Local time
Yesterday, 16:28
Joined
Oct 12, 2013
Messages
11
working like i want-

Step one:
Use a form to search for the record I want (I've tried using the table itself as the source, and an independent query)

step two:
once the appropriate source is selected, click a button, which saves record (there's a date to update from here) and then open a "confirmation" i made. a "are you sure you want to do this" type page.

step three:
click the confirm button. runs an append query, to copy the record to an archive table. then runs a few delete queries, deleting the record from the child tables, and then the master table. closes window.

PROBLEM
when closing the first form that found the record, i get the "record is deleted" error and all #deleted in the text boxes. i've tried requery, refresh, and everything else i can think of, but i can't find a way to close this form, after i've deleted the record, and not get an error.

any help is appreciated.
 
Probably Access is trying to do something with your first form on the deleted record. Maybe even the requery of the form. Hence the error.
 
well yea it's doing something with it, if i knew WHAT it was doing we wouldn't be here hahaha.

;) just giving ya a hard time friend, thanks for speaking up.
 
You'll have to post relevant code to gain any further insight to your problem.
 
So this is the code from the underlying table. (Access built all this for me. I'm familiar with the concept of the codes, but not fluent enough with the syntax to write it in code. I use macro builders and query builders).

SELECT [tblProfile/Master].ID, [tblProfile/Master].Last, [tblProfile/Master].First, [tblProfile/Master].MI, [tblProfile/Master].Div, [tblProfile/Rank].Rank, [tblProfile/Master].Member_Date, [tblProfile/Master].Last_Update, [tblProfile/Master].Remarks
FROM [tblProfile/Rank] INNER JOIN [tblProfile/Master] ON [tblProfile/Rank].ID = [tblProfile/Master].Rank
WHERE ((([tblProfile/Master].Last)=[forms]![frmProfile/Checkout]![Search]));

I couldn't get the code from the button on the confirm page, it's just the macro builder, it goes, open query (append), opens 4 delete queries, close window (don't save).

can't post images here yet, but basically the underlying form where i looked up the record to delete, nothing has changed. everything is exactly how i left it before i opened the "confirm" page and deleted the record.

does this help?
 
not a clean fix, but i found one.

all this was from a button click. so in the macro builder for the button click, i added an on error statement, which was go to next.

the next statement is close window, don't save. it works.
 
Try using the macro to close the form first and then run your queries.
 
Try using the macro to close the form first and then run your queries.

the queries were drawing from the form, so if i closed it first i would get "access can't tell its asshole from its elbow" kind of errors
 
From your first post with my additions in red

step three:
click the confirm button. runs an append query, to copy the record to an archive table. then runs a few delete queries, deleting the record from the child tables, and then the master table. closes (confirm) window and then closes the search form.

You just need to keep your body parts under control.


 
ran into a new problem today. i used this same process on another part of the db.

Background. I have a list of "members". There are three lists of members I want to maintain. "Active" "Inactive" and "Checked Out". I think that's fairly self explanatory. My earlier problem was going from "Active" to "Checked Out". I would run an append query to copy the record to the "Checked out", and a delete query to remove from the "Active" table where i found the record, all of this from a form that looks up the record from the "active" table. Again I fixed this problem with an error handler. it was the "can't save this record, do you want to close the database object anyways?"

Ok so fast forward, I'm having the exact same problem trying to move from "Active" to "inactive", with basically the same process. The difference, which I Can't figure out why, is I'm not getting an actual Error, just a notification "record is deleted". Since there's no actual error, I can't seem to get that pop up to go away with an on error statement.

Am I making any sense here?
 
You'd make life so much easier for yourself by adding a status field to your table. Not only easier in developing but reducing risk of data loss in transferring between tables. It's also easier to reverse the process to correct mistakes or changed status.
 

Users who are viewing this thread

Back
Top Bottom