Error: Record is Deleted

L

Lester

Hello,

I display records on the form. Then I delete one of the records directly
from the table. Then I want the form to redisplay the records except the one
that is deleted. However, I click on the form after the delete event I get
the error saying that the "Record is Deleted" and the fields of that record
are filled with "#Deleted". I tried to refresh, repaint and requery and
nothing worked.
I also, run a process on the same form where I append a record to the table
and the requery works fine. The new records appear on the form right away.
However, when I delete the records they are filled with the "#Deleted".

How to refresh the form to reflect the deletion of the record after delete
statement was run:
db.execute( "delete * from table1 where field1 = "blah")
me.requery <--doesn't work
me.refresh <--doesn't work

Any help is greatly appreciated,
Lester
 
D

Dirk Goldgar

Lester said:
Hello,

I display records on the form. Then I delete one of the records
directly from the table. Then I want the form to redisplay the
records except the one that is deleted. However, I click on the form
after the delete event I get the error saying that the "Record is
Deleted" and the fields of that record are filled with "#Deleted". I
tried to refresh, repaint and requery and nothing worked.
I also, run a process on the same form where I append a record to the
table and the requery works fine. The new records appear on the form
right away. However, when I delete the records they are filled with
the "#Deleted".

How to refresh the form to reflect the deletion of the record after
delete statement was run:
db.execute( "delete * from table1 where field1 = "blah")
me.requery <--doesn't work
me.refresh <--doesn't work

Any help is greatly appreciated,
Lester

How are you assigning your database variable, "db"? Are you using
CurrentDb or DBEngine(0)(0), or are you opening a separate connection to
the database? For me, this works fine:

Dim db As DAO.Database
Set db = CurrentDb

CurrentDb.Execute _
"DELETE FROM Table1 WHERE ID=" & Me.ID, _
dbFailOnError

Me.Requery

Set db = Nothing
 
R

Rick B

Lester:

Please do not post your questions in multiple groups. I'm sure you feel
your question is very important, but you do not need several people working
on it.

Rick B


Hello,

I display records on the form. Then I delete one of the records directly
from the table. Then I want the form to redisplay the records except the one
that is deleted. However, I click on the form after the delete event I get
the error saying that the "Record is Deleted" and the fields of that record
are filled with "#Deleted". I tried to refresh, repaint and requery and
nothing worked.
I also, run a process on the same form where I append a record to the table
and the requery works fine. The new records appear on the form right away.
However, when I delete the records they are filled with the "#Deleted".

How to refresh the form to reflect the deletion of the record after delete
statement was run:
db.execute( "delete * from table1 where field1 = "blah")
me.requery <--doesn't work
me.refresh <--doesn't work

Any help is greatly appreciated,
Lester
 
D

Dirk Goldgar

Rick B said:
Lester:

Please do not post your questions in multiple groups. I'm sure you
feel your question is very important, but you do not need several
people working on it.

Shoot, you mean you've already answered this someplace else? I hate
that!
 
R

Rick B

So far you seem to be the only person working on it, but he did post it in
FOUR groups!!!


Rick B said:
Lester:

Please do not post your questions in multiple groups. I'm sure you
feel your question is very important, but you do not need several
people working on it.

Shoot, you mean you've already answered this someplace else? I hate
that!
 
D

Dirk Goldgar

Rick B said:
So far you seem to be the only person working on it, but he did post
it in FOUR groups!!!

I'm sticking with this one. Lester, don't do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top