Results 1 to 5 of 5
  1. #1
    Zaonpt is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    2

    Question Question about insert

    Hi guys,
    I have a problem that I'm struggling to solve.
    I have two tables (link and linkhistory, example) that are essentially the same although when something is deleted ill remove only from the table link. this way I keep an history of old links on the other table and only the active links on the 1st one.


    I thought about merging this two and have a boolean field "active" but i feel that splitting the two concepts will make my life easier (maybe not).

    So my question is:
    Is there a way of when something is inserted in table link that will be automatic (via trigger or some access automatism) make the same insert in the linkhistory table.

    Notes:
    I know this approach violates all Database development rules, I am not sure yet will go with this, I'm just wondering if this is viable technically.

    TY

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Yes, it is technically viable and by more than one method. Here is one way to deal with http://allenbrowne.com/AppAudit.html
    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.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I would go with the "activeFlag" boolean, but you may get some ideas from this thread re Data macros.
    I posted an example using a table data macro and named data macros to create an Audit log in post 21 in that thread.

    Good luck.

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Just because something is technically viable, doesn't mean it's a good idea

    Instead, I would also support the idea of a boolean field Active.
    This means you would never delete existing records & do not need a second almost identical table

    However, I would also recommend you create backup copies of the entire database on a regular basis e.g. daily?

  5. #5
    Zaonpt is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    2
    TY all for the replies, i also think its better to use the boolean, its the current state my DB, its probably not gonna change.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-29-2016, 07:50 PM
  2. Replies: 3
    Last Post: 05-27-2015, 01:04 PM
  3. Insert Into SQL Question.
    By Robeen in forum Access
    Replies: 3
    Last Post: 01-23-2015, 01:48 PM
  4. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  5. Replies: 4
    Last Post: 08-25-2012, 07:19 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