ML
Oct 15th, 1999, 05:00 AM
This is most bizarre.
I have tried to delete records (in an Access database) in my project several different ways using querydefs, SQL DELETE statements and finally I wrote a function to delete a record resulting in a recordset from a SELECT statement using the rstVariable.delete method. I know all of my different attempts should have worked but none of them have. Stepping through the code, checking variables, everything is fine, the code runs without errors. It pretends to delete the record!!! But when I return to Access or end the project and try again the record is still there.
In the error handler routine for the function, if the function is successful, it exits the function.
It works every time unless I try again in the same session. Obviously, it deletes the recordset record but doesn't update the database. I know it should work!!! There is nothing wrong.
Finally in desperation, I pasted the code into a new project, invoked the function from a command button and it worked - the exact same code! It has to be something different between the 2 projects, what can I look for?
What is wrong? I cannot figure this one out -please help, it has been a week of writing and rewriting.
I have tried to delete records (in an Access database) in my project several different ways using querydefs, SQL DELETE statements and finally I wrote a function to delete a record resulting in a recordset from a SELECT statement using the rstVariable.delete method. I know all of my different attempts should have worked but none of them have. Stepping through the code, checking variables, everything is fine, the code runs without errors. It pretends to delete the record!!! But when I return to Access or end the project and try again the record is still there.
In the error handler routine for the function, if the function is successful, it exits the function.
It works every time unless I try again in the same session. Obviously, it deletes the recordset record but doesn't update the database. I know it should work!!! There is nothing wrong.
Finally in desperation, I pasted the code into a new project, invoked the function from a command button and it worked - the exact same code! It has to be something different between the 2 projects, what can I look for?
What is wrong? I cannot figure this one out -please help, it has been a week of writing and rewriting.