Results 1 to 2 of 2
  1. #1
    gszdwml is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    1

    Help Me! Save Record Command Button issue

    I am trying to have a record saved when i click on my "Resolve Alarm and Close Tkt" button on my "ARMS Single Tkt Display" form. This process is supposed to save the record to the "ChronicTkt# T" table , then copy it to the "ClosedTktT", then delete it from the "ChronicTkt# T". The problem I have is that when I type "Yes" in the "Close Tkt" field, it does not save the text when copying over to the new table(ClosedTktT).

    Also, all records are copied over to the new table, instead of the record I am currently on. How do I prevent or address these issues?
    THANKS FOR ANY HELP given.

    Please take a look at the attached dB File.

    My VBA code,

    Private Sub Save_and_Close_Form_Click()
    DoCmd.DoMenuItem A_FORMBAR, A_EDIT, A_SELECTRECORD
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.Save
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.Refresh
    DoCmd.Requery
    DoCmd.SetWarnings False
    DoCmd.RunSQL "INSERT INTO [ClosedTktT] SELECT * FROM [ChronicTkt# T] WHERE [Chronic Tkt Number] = [Chronic Tkt Number]"
    DoCmd.SetWarnings True
    DoCmd.DoMenuItem A_FORMBAR, A_EDIT, A_SELECTRECORD


    DoCmd.DoMenuItem A_FORMBAR, A_EDIT, A_DELETE
    DoCmd.Close
    End Sub
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    DoCmd.RunSQL "INSERT INTO [ClosedTktT] SELECT * FROM [ChronicTkt# T] WHERE [Chronic Tkt Number] = " & Me.[Chronic Tkt Number]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Command Button Matching Records Issue
    By Lupson2011 in forum Programming
    Replies: 1
    Last Post: 02-09-2012, 10:08 AM
  2. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  3. Command Button Border Transparency Issue!
    By JeffG3209 in forum Database Design
    Replies: 4
    Last Post: 06-29-2011, 07:50 PM
  4. Command button issue
    By sloppysly in forum Forms
    Replies: 8
    Last Post: 06-15-2009, 12:07 PM
  5. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 PM

Tags for this Thread

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