Checking record status

G

Guest

Hi.

I'm trying to loop through a recordset before any deletions are confirmed,
so that the records marked for deletion can be transfered to another table.

Unfortunately, cloning the recordset of the form doesn't help - once you've
chosen a record and hit delete, the record is removed from the form's
recordset. I thought it was just marked for deletion, but that doesn't appear
to be the case.

Can I get the records from elsewhere? And how do I check whether they have
been marked to be deleted? I had tried
IF CurrentRecords.RecordStatus = dbRecordDeleted Then ...
but that tells me the operation isn't supported.
 
A

Arvin Meyer [MVP]

Why don't you create your own delete routine which actually transfers the
records instead of deleting them outright? If you turn off the form's
ability to delete, your problem is solved (unless you allow your users
access to tables)
 
G

Guest

Hi,

That sounds like a possibility I hadn't thought of - I was stuck with the
idea that I must use the Before Del Confirm, After Del Confirm events.

So I'm thinking about a button on the form, which once clicked, will move
the selected records. Do you know how I would get the selected records? I
can't see any properties or methods in the form or the form's recordset that
I could use.

Cheers,

Mike
 
G

Guest

Actually, I appear to have just found it with seltop and selheight in the
form...
 
A

Arvin Meyer [MVP]

mkj said:
Actually, I appear to have just found it with seltop and selheight in the
form...

Yes, those are the properties. You can also use the form's click event to
delete them. I prefer not to even delete records. What I do is to use a
checkbox and requery the form's recordsource:

Select * From MyTable Where CheckBox = False

The "deleted" records are still there, but you don't see them. I can
wholesale move them any time a want.

Select * Into NewTable Where CheckBox = True
Delete * From MyTable Where CheckBox = True
 

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