Not delete record, hide/deactivate?

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Hi

I have a set of forms connected to my tables.

Currently i let users remove records.
But id like to stop that and instead find a way to hide or deactivate the records instead of running the delete command.

Does access support something like this?
Or do i have to build something?

If i have to build something... im thinking of having a archive table for every table i create and move records to them instead of deleting... but this will be quite messy i believe....

any ideas on how to do this?

another idea is to create a column that gets an value "INACTIVE" and then i need to filter everything i do so those records are not shown... but i have no clue if this is doable or how i should approach it.
 
I would probably prefer to make sure that the ID you are using is never missing - in which case I would expect no errors on this SQL command. Assuming that this is not mission critical of course.
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I believe that should any issue arise, such as the record being locked, you wouldn't know it. Not sure of that example per se but it will do to get my guess across, which is that it has to do with more than just bullet proof sql.
 
Upvote 0
That's fine. I just don't think it's necessary in all situations that's all. I usually don't use that option. Shoot me.
 
Upvote 0
Shoot me.
Rather flippant for a moderator?
Never said it was necessary in all situations but I did test 2 without it.
Put a lock on the record, ran an update sql and no message.
Put an index on a field (no dupes); attempted to duplicate a value and no message.
Added dbFailOnError and raised an error message both times. If there is a failure half way through the updating, you can't roll back without it and the companion transaction.

You're entitled stick to your habits. I just don't see why anyone would take the risk considering how easy it is to just add it for protection, regardless of whether or not a transaction is used.
 
Last edited:
Upvote 0
My contribution was simply that it would be better to do something with the error. Since you advise using this option I just wanted to point out that if errors are uncaught then may end up with users confused by what happens at the time of failure. That's all. Whether it's needed or not, who knows. I'd need to know a lot more about how this database is used and what is going on with these forms and tables. Personally I consider not updating a locked record and not duplicating a key "correct" behavior in a lot of situations :) - Access is doing exactly what I'd expect. Like I said, it depends on the situation whether I'd need to know about it and mostly in my work it wouldn't.
 
Last edited:
Upvote 0
Thanks allot for both of your help!

Me as all new to access, just been working with it for two weeks. Clearly there are areas i have not yet even started to think about. My approach is often to build what i need and solve problems on the go. Error handling i never really understood in excel. So ill get to this soon ??.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,201
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top