Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 04-24-2012, 12:54 AM   #1
gszdwml
Newly Registered User
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
gszdwml is on a distinguished road
Help please! Save Cmd Button not wkng

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 in my form, it does not save the text when copying over to the new table(ClosedTktT). Also, all records are copied on just the record I am on.


Please see my attached dB file.

My VBA code from my Button


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
File Type: zip ARMS Project-1751.zip (1.31 MB, 88 views)

gszdwml is offline   Reply With Quote
 

Tags
button , delete , save , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question How i create a Save Button and A Clear Form Button? Amenofhis General 8 08-16-2012 09:51 AM
Save Button Kiki5454 Forms 18 03-14-2012 07:59 AM
Only save record in subform when a save button is pressed patkeaveney Forms 3 02-05-2008 03:30 PM
Save Button versus Save safety net monkeytunes Modules & VBA 8 09-01-2004 12:17 PM
Combine custom save button on subform with save button on main form popeye Forms 2 08-27-2004 07:58 AM




All times are GMT -8. The time now is 09:36 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World