Results 1 to 5 of 5
  1. #1
    dkeeper09 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    15

    Delete Records

    Hey guys,

    I want to see if this can be done. I have an employee and asset database. If an employee gets fired, I need remove them from the general employee records, but I want to save a record of that employee. Is there a way to delete an employee from one table and have it automatically added to another table?
    Hope that makes sense.
    Any help is appreciated. Thanks!

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    How about including a boolean or integer checkbox field on the employee table called "Active". Active employees will have this box checked. Terminated employees will have the box unchecked. Then you can have a query called "qryEmployees" whose SQL looks like this: "Select * from Employees where Active;". You can then use qryEmployees as the basis for all of your active employee forms and reports. Create another query called "qryTerminatedEmployees" with this SQL: "Select * from Employees where not Active;". Use THAT as the source for any forms or reports for terminated employees.

  3. #3
    dkeeper09 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    15
    Ok. I got that working. Thanks a lot!
    Now lets say I have a form that uses the active employee query. Is there a way to create a button that would automatically mark the employee as inactive, so next time it runs it wont show? Maybe change the coding on the delete record button?

  4. #4
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Just put the "Active" control on the employees form. Format it as a check box.

  5. #5
    dkeeper09 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    15
    Awesome. Thank you very much!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Delete all records
    By stryder09 in forum Access
    Replies: 6
    Last Post: 05-11-2011, 02:07 PM
  2. delete records
    By fiamma68 in forum Queries
    Replies: 0
    Last Post: 11-15-2010, 06:54 PM
  3. Delete all records in a field
    By cotri in forum Forms
    Replies: 6
    Last Post: 01-29-2010, 02:44 PM
  4. #delete records
    By supernova122 in forum Access
    Replies: 0
    Last Post: 07-08-2009, 08:41 AM
  5. Delete all records in a table?
    By bob646 in forum Access
    Replies: 1
    Last Post: 05-20-2007, 11:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums