Ms Access Vba Error 2118
Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Unable to Execute Requery Action 100+ P: 124 bullfrog83 I have a pop up form bound to a table. When I close the pop up form, I want to requery another form because it aggregates data related to my pop up form. So, on the OnClose event of my pop up form I have: Forms!f_Main!sfrmDegReq.Requery However, when I close the form I get the following error: Run-time error 2118: You must save the current field before you run the requery action. I have no idea which field it is referring to. The record is saved in the table. And this doesn't happen everytime. I suppose I could absorb the error in my error handling but I would prefer to try to find out what the problem is and resolve it if possible. May 14 '10 #1 Post Reply Share this Question 3 Replies Expert 2.5K+ P: 3,532 missinglinq Is the popup being form called from the form you're trying to requery? If so, you may need to save the current record on that form before calling the popup, using something like If Me.Dirty Then Me.Dirty = False Linq ;0)> May 14 '10 #2 reply 100+ P: 124 bullfrog83 @missinglinq Yes, the popup is being called from the form I'm trying to requery. However, after selecting a value in my last required combobox I have the following in the combobox's AfterUpdate event: DoCmd.RunCommand acCmdSaveRecord Should I replace this with the code you provided? Also, I'm not getting the error now so I'm going to have to wait until I get it again. May 14 '10 #3 reply Expert 2.5K+ P: 3,532 missinglinq Either will do the job, but the error message would indicate that the popup is sometimes being called before a selection is being made from the last required combobox or after the selection is made and after data in another control is added or changed, hence making the form Dirty again. I'd place either code immediately before the line to open the popup form. Linq ;0)> May 14 '10 #4 reply Message Cancel Changes Post your reply Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics Action pass-through with a form variable Access 2003 Requery Error adodb.connection.execute; close returned recordset? Action link Combobox Requery Onchange Custom Action during Setup! Requery of Subform with combo box Docmd.Requery doesn't work under Access 2K .requery with sub form docmd.RunSQL Update records in table how can I get rid of the "You are about to update" message Browse more Microsoft Access / VBA Questions on Bytes Question stats viewed: 7621 replies: 3 date
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 3 of 3 Thread: Error 2118 on listbox requery. Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 07-18-02,09:36 https://bytes.com/topic/access/answers/888100-unable-execute-requery-action #1 mkorman View Profile View Forum Posts Registered User Join Date Jul 2002 Posts 3 Unanswered: Error 2118 on listbox requery. I am creating a database that has a listbox which queries a table to populate itself. It requeries based on the OnTimer event of the form it resides on, with a timer interval of 1000ms. Every once and a http://www.dbforums.com/showthread.php?434982-Error-2118-on-listbox-requery while, this error appears, and I cannot figure out why. Any help is appreciated. Reply With Quote 07-19-02,02:24 #2 Apel View Profile View Forum Posts Visit Homepage Registered User Join Date Apr 2002 Location Germany Posts 228 "The action 'Requery' can't be executed as long as the field is not saved" (or something like that, translated from German) Looks like you have unsaved data entered in the control at the time you try to requery it. If you execute a requery at that point access doesn't know what to do with the data. Try to run a RunCommand acCmdSaveRecord or issue an undo before you execute the requery. Reply With Quote 07-19-02,08:17 #3 mkorman View Profile View Forum Posts Registered User Join Date Jul 2002 Posts 3 Thank you, the "RunCommand acCmdSaveRecord" worked Though, I still don't understand the problem. I discovered that the error appears every time I click on the listbox at the same time as it is requerying. Why would that be? Reply With Quote Quick Navigation Microsoft Access Top Site Areas Settings Private Messages Subscriptions Who'
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 https://www.experts-exchange.com/questions/28470360/error-2118-must-save-before.html 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 http://computer-programming-forum.com/1-vba/ed587c97a398a677.htm BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > error 2118, must save before Want to Advertise Here? Solved ms access error 2118, must save before Posted on 2014-07-06 MS Access 1 Verified Solution 4 Comments 926 Views Last Modified: 2014-07-07 The error reads: Run-time error 2118 You must save the current field before you run the Requery action. and the debug takes me to: Forms![f00Dashboard]![f00BaseForm].Form![Chart01].Requery (this code is in a form module) How do ms access vba I include save command prior to this line so that it will work even after I make an exe file from this application. Thanks, 0 Question by:Mike Eghtebas Facebook Twitter LinkedIn Google LVL 48 Active today Best Solution byGustav Brock How about setting Dirty = False? /gustav Go to Solution 4 Comments LVL 33 Overall: Level 33 MS Access 30 Message Author Comment by:Mike Eghtebas2014-07-06 btw, I solved this using: Forms![f00Dashboard]![f00BaseForm].Form![Chart01].RowSource=Forms![f00Dashboard]![f00BaseForm].Form![Chart01].RowSource instead of Forms![f00Dashboard]![f00BaseForm].Form![Chart01].Requery But I wait for your comment before I close the question. Mike 0 LVL 48 Overall: Level 48 MS Access 47 Message Active today Accepted Solution by:Gustav Brock2014-07-07 How about setting Dirty = False? /gustav 0 LVL 33 Overall: Level 33 MS Access 30 Message Author Comment by:Mike Eghtebas2014-07-07 I will try that too. Thanks, Mike 0 LVL 48 Overall: Level 48 MS Access 47 Message Active today Expert Comment by:Gustav Brock2014-07-07 You are welcome! /gustav 0 Write Comment First Name
Kasema#1 / 9 Run-time error '2118': You must save the current field before you run the Requery action. This run-time error appeared on the screen: "Run-time error '2118': You must save the current field before you run the Requery action." The line that was highlighted in yellow when the I clicked the 'Debug' button is: MyListBox.Requery What is the "current field" referring to in this run-time error? Is it a text box? Sun, 22 May 2005 23:44:51 GMT Neil#2 / 9 Run-time error '2118': You must save the current field before you run the Requery action. The current field is the one you are trying to requery. In this case MyListBox. Neil. Quote:> This run-time error appeared on the screen: > "Run-time error '2118': You must save the current field before you run the > Requery action." > The line that was highlighted in yellow when the I clicked the 'Debug' > button is: > MyListBox.Requery > What is the "current field" referring to in this run-time error? Is it a > text box? Mon, 23 May 2005 00:09:36 GMT Daniel Kasema#3 / 9 Run-time error '2118': You must save the current field before you run the Requery action. So how do I *save* the current field? Quote:> The current field is the one you are trying to requery. In this case > MyListBox. > Neil. > > This run-time error appeared on the screen: > > "Run-time error '2118': You must save the current field before you run > the > > Requery action." > > The line that was highlighted in yellow when the I clicked the 'Debug' > > button is: > > MyListBox.Requery > > What is the "current field" referring to in this run-time error? Is it a > > text box? Mon, 23 May 2005 00:14:07 GMT Daniel Kasema#4 / 9 Run-time error '2118': You must save the current field before you run the Requery action. Thank you, grey. But when I open the database it says "Unrecognized database format" I am using Access 97. Could I have the same kind of database in 97 format? Thank you, Daniel Quote:> Is this caused by a Not-In-List handler? > If you have a NIL handler, don't requery the control. If > your code adds an entry to the list, ask MS Access to > automatically requery the control by using > Response = acDataErrAdded > MS Access will then requery