Results 1 to 8 of 8
  1. #1
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202

    Move a single record to an archive table

    I would like to make a "Kill" button that when pressed will move the selected record from my "Tasks" table to my "Archive" table which contains outdated records that are no longer being worked on.



    Is there an easy way to do this?

    TIA.

    Edit: Preferably with a dialog box that asks if you're sure you want to kill the ticket.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    This link should help: http://allenbrowne.com/ser-37.html

  3. #3
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    That link portrays exactly what I need to do. I have taken the code from that page and tweaked it to resemble my database and what needs to get backed up however when I run the command it returns the following error:

    "An INSERT INTO query cannot contain a multi-valued field."

    What exactly is a "multi-valued field" or what is stopping this from running correctly?

  4. #4
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    It ended up being the Attachments field which I guess can not be transferred which is too bad because we attach important PDF's that should stay with the archived records.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You should then be able to do it with a Recordset a field at a time using a query to delete the original record if successful.

  6. #6
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Ok thank you I will look in to that.

    Another ?, is there a specific line of code to refresh the database?

    I have built my Kill Switch and put the KillYesNo check box next to it, but it doesn't work unti after I manually refresh the database once I have checked the box. Curious if I can add a command in the button code that will refresh the database before it runs through it's set of commands.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Changing a control on a form does *not* change any fields to which they are bound until the record is saved. You can do that with Me.Dirty = False if you want.

  8. #8
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows 7 64bit Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Thank you RG, that worked splendid.

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

Similar Threads

  1. Replies: 5
    Last Post: 03-23-2011, 10:39 AM
  2. Update single record via forum, not entire table?
    By 10 Gauge in forum Programming
    Replies: 2
    Last Post: 02-11-2011, 09:14 AM
  3. Replies: 7
    Last Post: 11-13-2010, 08:08 AM
  4. Delete button with archive Table
    By tlyons in forum Forms
    Replies: 4
    Last Post: 07-08-2010, 12:18 PM
  5. Move a record from one table to another table.
    By botts121 in forum Programming
    Replies: 4
    Last Post: 06-25-2009, 12:53 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