Ms Access Error #2046 Saverecord
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Run-Time Error 2046 The command or action 'SaveRecord' isn't available now Want to Advertise Here? Solved Run-Time Error 2046 The command or action 'SaveRecord' isn't available now Posted on 2008-05-07 MS Access 1 Verified Solution 2 Comments 2,411 Views Last Modified: 2011-10-03 I converted my access database from 2000 to 2003 Trying so call a small subform using the following command DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, acMenuVer70 Run-Time Error 2046 The command or action 'SaveRecord' isn't available now I tried the following command after looking at other errors in the knowledge base DoCmd.RunCommand acCmdSaveRecord Still get the same error What can I do to correct this problem. 0 Question by:needhelpfast569 Facebook Twitter LinkedIn Google LVL 75 Active today Best Solution byDatabaseMX (Joe Anderson - Access MVP) Instead of: DoCmd.RunCommand acCmdSaveRecord Try Me.Dirty = False ' Save record mx Go to Solution 2 Comments LVL 75 Overall: Level 75 MS Access 75 Message Active today Accepted Solution by:DatabaseMX (Joe Anderson - Access MVP)2008-05-07 Instead of: DoCmd.RunCommand acCmdSaveRecord Try Me.Dirty = False ' Save record mx 0 Message Author Closing Comment by:needhelpfast5692008-05-07 Thanks worked great 0 Write Comment First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. Comment Submit Your Comment By clicking you are agreeing to Experts Exchange's Terms of Use. Featured Post How to run any project with ease Promoted by Quip, Inc Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans. - Combine task lists, docs, spreadsheets, and chat in one - View and edit from mobile/offline - Cut down on emails Try Quip Free! Suggested Solutions Title # Comments Views Activity MS Access embed an Excel downloaded template file on form 7 24 17d MS Access Search and Replace Using VBA 6 27 13d Subform Link field 13 19 3d joining two tables on primary key bu
VBA Code & Other Help Access Help Why am I receiving a run time error '2046' message on a save button option? If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 4 of 4 Thread: Why am I receiving a run time error '2046' message on a save button option? Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-17-2011,03:14 AM #1 wedd View Profile View Forum Posts View Blog Entries View Articles VBAX Mentor Joined Aug 2010 Posts https://www.experts-exchange.com/questions/23384201/Run-Time-Error-2046-The-command-or-action-'SaveRecord'-isn't-available-now.html 457 Location Why am I receiving a run time error '2046' message on a save button option? Hi, I created a save button with options to either save the record yes or no. When I click on no option the following error message appears. "Run Time error '2046': The command or 'Undo' isn't available now", However when I click yes nothing happens. Why has this occured and how can I hide this message? I've written the code out below: Thanks for your contributions http://www.vbaexpress.com/forum/showthread.php?35720-Why-am-I-receiving-a-run-time-error-2046-message-on-a-save-button-option Private Sub Command21_Click() Dim strMsg As String Dim iResponse As Integer ' Specify the message to display. strMsg = "Do you wish to save the changes?" & Chr(10) strMsg = strMsg & "Click Yes to Save or No to Discard changes." ' Display the message box. iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") ' Check the user's response. If iResponse = vbNo Then ' Undo the change. DoCmd.RunCommand acCmdUndo ' Cancel the update. End If End Sub Reply With Quote 01-17-2011,10:07 AM #2 Imdabaum View Profile View Forum Posts View Blog Entries View Articles VBAX Expert Joined Jun 2006 Posts 649 Location ' Check the user's response. If iResponse = vbNo Then ' Undo the change. DoCmd.RunCommand acCmdUndo 'ELSE WHAT? 'code to save the record ' Cancel the update. Formatting tags added by mark007 Your code handles the vbNo. But it doesn't do anything if they say yes. Someday I'll understand everything... Even then...I'll still pretend I'm a beginner. Reply With Quote 01-17-2011,12:45 PM #3 hansup View Profile View Forum Posts View Blog Entries View Articles VBAX Mentor Joined Feb 2009 Posts 447 Location Originally Posted by wedd Hi, I created a save button with options to either save the record yes or no. When I click on no option the following error message appears. "Run Time error '2046': The command or 'Undo' isn't available now", However when I click yes nothing happens. Why has this occured and how can I hide this
I have an access 2000 database that I just inherrited. Everything has been working fine until today. I have a subform that has a drop down list http://www.pcreview.co.uk/threads/runtime-error-2046-saverecord-is-not-availble-now.1160631/ that after performs the follwoing: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 it is at this line that I encounter the runtime error '2046' The action or command 'SaveRecord' is not available now. I have debugged and debugged and am at a loss... Why would this "all of a sudden" start to occur? What could I have possbly have done that would cause this to break? Any insight ms access or advice would be greatly appreciated! Thanks Guest, Mar 9, 2005 #1 Advertisements Guest Guest So I jusr tried the If Me.Dirty = true then Me.Dirty = fals trick and it worked.... but I am still curious as to why? Thanks again "Tsuki" wrote: > I have an access 2000 database that I just inherrited. Everything has been > working fine until today. I have a ms access error subform that has a drop down list that > after performs the follwoing: > DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 > > it is at this line that I encounter the runtime error '2046' The action or > command 'SaveRecord' is not available now. > > I have debugged and debugged and am at a loss... Why would this "all of a > sudden" start to occur? What could I have possbly have done that would cause > this to break? > > Any insight or advice would be greatly appreciated! > Thanks Guest, Mar 9, 2005 #2 Advertisements Guest Guest Hi Tsuki, Are you getting this message whilst you are in "Break" mode debugging? If so then that is why, you cannot run that command in Break. If not, try "DoCmd.RunCommand acCmdSaveRecord" - that is the MS preferred method, the other method is for backwards compatability. "Tsuki" wrote: > > So I jusr tried the > If Me.Dirty = true then Me.Dirty = fals > trick and it worked.... but I am still curious as to why? > > Thanks again > > "Tsuki" wrote: > > > I have an access 2000 database that I jus