Remove record (1 Viewer)

ethan.geerdes

Registered User.
Local time
Yesterday, 16:32
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?
 

plog

Banishment Pending
Local time
Yesterday, 18:32
Joined
May 11, 2011
Messages
11,658
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.
 

GinaWhipp

AWF VIP
Local time
Yesterday, 19:32
Joined
Jun 21, 2011
Messages
5,899
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...
 

ethan.geerdes

Registered User.
Local time
Yesterday, 16:32
Joined
Jun 4, 2015
Messages
116
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?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 09:32
Joined
Jan 20, 2009
Messages
12,853
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
 

ethan.geerdes

Registered User.
Local time
Yesterday, 16:32
Joined
Jun 4, 2015
Messages
116
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?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 09:32
Joined
Jan 20, 2009
Messages
12,853
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

Top Bottom