Results 1 to 7 of 7
  1. #1
    Urban is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2022
    Posts
    2

    Making Inactive records across tables


    Is it possible to deactivate a record in one table and have all corresponding records deactivate in he database? For instance, in table a, can i deactivate a record record X, and have it deactivate in tables b and c as well?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    if records in table b and c are child tables of table a, then you just deactivate the record in table a - records in tables b and c will then be deactivated by association

  3. #3
    Urban is offline Novice
    Windows 11 Access 2019
    Join Date
    Nov 2022
    Posts
    2
    Is there a way to use format a check box in a table to do this function? and if so, could checking it yes, then no, then yes make the record activate, deactivate, then activate again?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Quote Originally Posted by Urban View Post
    Is there a way to use format a check box in a table to do this function? and if so, could checking it yes, then no, then yes make the record activate, deactivate, then activate again?
    Yes and yes. Any form or report would be based on a query that includes the check field with criteria as T or F as required. YN fields provide minimal information. An alternative is a date/time field name such as Obsolete or Archived or such. If there is a date, it's true or false depending on what the field is all about. Just food for thought.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    Active and inactive are not formal concepts. You will therefore have to explain what you mean by this and what the consequences are if a record is not active, for example. If you create a yes/no field in your table (as suggested), this does not mean that Access will automatically do something with it.


    It's not clear to me what you mean by deactivating a record in multiple tables. A record can only exist in one table. When it comes to related records in a one-to-many relationship, the question is again what the deactivation means for the related records. Depending on that question, you will also have to take measures for the related tables. Access does not do that automatically either.
    Groeten,

    Peter

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    A record is 'deactivated' if a field value indicates so and then a query criteria excludes records with that value (or lack of value as in a date/time). If parent record is not retrieved in query joining tables then the related child records will not retrieve. However, nothing prevents opening any table independently and viewing all records. Depends on your design and how you manage user interaction with db objects.

    So if you 'deactivate' an employee (separation by whatever reason) with value in a date/time field and you query the Employees table for only 'active' employees (field IS NULL), then that's what you get - along with any related records in dependent tables included in query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    In our application we have 2 bit fields IsActive and IsDeleted. The latter because we don't allow physical deletions. Inactive records are not shown in actual queries (for example inactive customers are not shown when creating a new sales line) but are shown in historical overviews. Deleted records are never shown.

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

Similar Threads

  1. Database Design to Maintain Inactive Employee Records
    By Tylin in forum Database Design
    Replies: 6
    Last Post: 03-03-2018, 01:11 PM
  2. Replies: 6
    Last Post: 01-15-2014, 02:56 PM
  3. Active Records Vs Inactive Records
    By ClawGee in forum Database Design
    Replies: 4
    Last Post: 05-07-2012, 08:13 PM
  4. Making an inactive button Help
    By ericfatherree in forum Programming
    Replies: 2
    Last Post: 02-05-2012, 11:05 PM
  5. Replies: 1
    Last Post: 12-06-2006, 05:32 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