How to Archive Record automatically?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eneyardi
    New Member
    • Jul 2010
    • 180

    How to Archive Record automatically?

    How to archive record automatically, i just want record to move in other table automatically when record contains (completed) in field STATUS.
  • colintis
    Contributor
    • Mar 2010
    • 255

    #2
    You will need 2 queries, and a macro that executes the queries.

    1 query appends the record to the table you want to move, and the other one removes that record from the old table.

    Hints, use the HAVING clause for checking the status is completed or not.

    Comment

    • eneyardi
      New Member
      • Jul 2010
      • 180

      #3
      thnx, but how can i do this?

      Comment

      • colintis
        Contributor
        • Mar 2010
        • 255

        #4
        Queries are made of SQL statements, go take a look on some tutorials on how to write SQL.

        An example of the 2 queries are below, let say move from table A to B. The first one is copying the records from A to B, then the second one will delete the records in A.
        Code:
        INSERT INTO TableB
        SELECT TableA.*
        FROM TableA
        HAVING STATUS = 'completed';
        Code:
        DELETE TableA.*
        FROM TableA
        HAVING STATUS = 'completed';
        Then for the macro you'll simple select the action of OpenQuery and select the 2 queries in order, and ending it by selecting the StopMacro action.

        Comment

        • eneyardi
          New Member
          • Jul 2010
          • 180

          #5
          where can i put this code?

          Comment

          • colintis
            Contributor
            • Mar 2010
            • 255

            #6
            I think you should read some tutorials on understanding the concepts, as it is difficult to tell you exactly how to do step-by-step.

            This tutorial website should help you understand most of the basics, they provide the access tutorial for different versions.

            Comment

            Working...