Remove record

ethan.geerdes

Registered User.
Local time
Today, 02:36
Joined
Jun 4, 2015
Messages
116
Hello everyone. I have a table that has a list of all the people that work for the company. I have a form that I want to use to easily remove people that have the misfortune of getting fired. I have a button that is labeled "remove" and the "on click" event, I used the wizard "delete record" option but it isn't deleting what I select in the combo box. I am guessing I need to create a delete query?
 
Data usually doesn't get deleted from databases in situations like that. Instead the record is marked so that you can determine they are no longer employed.

I suggest adding a [TerminationDate] field instead and puting a date in there to designate past employees.
 
Hmm, so if that person is *attached* to another record in another table what happens? I would add an Archive checkbox and like Plog says, hide it. That would allow options so you can still see those records that are in other tables...
 
What would I need to do to hide the person after they leave? Lets say I knew the date that they were going to be leaving (I know being fired is unpredictable) but statistics show that people usually hold a job for between two and five years. if I had like a date three years from the date they were hired, can I make it auto hide? How would I go about that?
 
Use TerminationDate.

Your form probably is built on a table. Just change the RecordSource Property from the table name to a query.

Code:
SELECT * FROM tablename WHERE TerminationDate Is Null
 
So, instead of removing them, I can just set it up so that they don't show up in a list once they hit the "expiration" date? Do I need to configure that in the Table or on the form?
 
The table should have a field called something like TerminationDate. The query will no longer return the record once a date is entered in this field.

You don't need to guess when they are going to be terminated. Simply enter a date when the employee leaves to indicate termination.
 

Users who are viewing this thread

Back
Top Bottom