Delete Function

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

Guest

I have a .db that tracks computer equipment. On one of my forms I currently
have a command button that is setup to delete records. I no longer want to
delete them but instead make them inactive so I created another cmd button
that when depressed will inactivate them rather than delete. I created an
inactive checkbox and two other fields that when the checkbox is checked it
automatically populates the fields with the date and current user. What I
would like to do if possible is have the delete cmd button disabled after it
is pressed once that way it can't be accidently undeleted by mistake. Or
even make the whole record locked. What would be the code that I can put
behind the button in order to do this or can this even be done?

I also have added a toggle button to the form that I would like to apply a
filter so that I can see active or inactive by toggling the button but I'm
not sure how to do this. Would I need to add code on click on the button.

Any help would be appreciated.
 
Franca said:
I have a .db that tracks computer equipment. On one of my forms I currently
have a command button that is setup to delete records. I no longer want to
delete them but instead make them inactive so I created another cmd button
that when depressed will inactivate them rather than delete. I created an
inactive checkbox and two other fields that when the checkbox is checked it
automatically populates the fields with the date and current user. What I
would like to do if possible is have the delete cmd button disabled after it
is pressed once that way it can't be accidently undeleted by mistake. Or
even make the whole record locked. What would be the code that I can put
behind the button in order to do this or can this even be done?

I also have added a toggle button to the form that I would like to apply a
filter so that I can see active or inactive by toggling the button but I'm
not sure how to do this. Would I need to add code on click on the button.

Any help would be appreciated.

Assuming that the checkbox is called chkInactive:

Me.AllowEdits = Not(chkInactive)

You will also need this same statement in the form's Current event
procedure.
 

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

Back
Top