473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Unable to Execute Requery Action

124 100+
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
3 15166
missinglinq
3,532 Expert 2GB
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
bullfrog83
124 100+
@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
missinglinq
3,532 Expert 2GB
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

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to...
2
by: Gianluca_Venezia | last post by:
Scenary: a main form contains two sub-form unbounded. Sub-form "one" contains a list of products. Sub-form "two" contains the items of the selected product. Event: when, from sub-form "two",...
2
by: Wayne | last post by:
I've found a few posts on this subject but no reason for the behaviour. Is there any logical reason that Docmd.Requery "MyControl" won't work under Access 2K but Me.Requery.MyControl will? Is...
1
by: packwood | last post by:
I have a subform that has a query on another table. One of the fields is based on the contents of another table. When the user selects one or other option in the main form I want the the records...
3
by: Vai2000 | last post by:
Hi All, I need to execute custom action during installation of my program (through MSI). Creating the MSI was pretty straight fwd. After that I went into the Custom Action Editor and added the...
6
by: Gil | last post by:
Hello, I want a combox to requery each time it is being changed. What i am trying to do is have the combo box filter to the text being entered. The combo1 rowsource is: SELECT * FROM tbl WHERE...
2
by: Mark Towner | last post by:
Greetings, Does anyone have a solution for this problem: - I would like a PHP script to execute an action before a user clicks on a link (updating the value of a variable, for instance). Is...
6
by: robert.waters | last post by:
Hello, Do you need to close an adodb recordset returned from a connection.execute(SQL) action? ex) set rcd = con.execute("SELECT * FROM TABLENAME") I know that close()ing objects that you...
1
by: sigimaldonado | last post by:
I created a drop down list with a list of names. if the name does not apper on the list you can double click and then you can enter the name on a separate form. after closing the second form y...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.