Inactivate vs. Delete

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When my users opt to delete a record, I'd like to circumvent their choice by
updating a boolean "Active" field to "No" instead (my field name is iteActive.

When I put the following code in my Form_Delete(Cancel as Integer)
procedure, the update as well as the deletion is canceled.

iteActive = False
Cancel = True

How can I achieve my goal?
 
When my users opt to delete a record, I'd like to circumvent their choice by
updating a boolean "Active" field to "No" instead (my field name is iteActive.

When I put the following code in my Form_Delete(Cancel as Integer)
procedure, the update as well as the deletion is canceled.

iteActive = False
Cancel = True

How can I achieve my goal?

I'd simply disable deletion altogether (set the Form's AllowDeletes
property to False) and put a command button - or even just a checkbox
- on the form to set itsActive to false. You can of course base the
Form on a query selecting itsActive = True; if you requery the form in
the button code, the "deleted" record will disappear, reassuring the
user that what they've done had an effect.

John W. Vinson[MVP]
 
Thanks, John. I definitely want to leave the deletion ability for users who
are accustomed to this ability. I just want it to go my way...:) I'll give
Rob's suggestion a try...
 
Back
Top