Darryl Collins
Darryl.Collins at iag.com.au
Mon Aug 30 22:27:04 CDT 2010
_______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Thanks Steve, Yeah, bog standard select queries (well the final query is a union on several underlying queries, but they are all SELECT). I am pretty sure it is more to do with the how the form is behaving. bah.. bound forms ;) cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel Sent: Tuesday, 31 August 2010 1:10 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Force Query to recalc using code. Darryl, Assuming you are talking here about Select queries, then they don't need to be run/updated/refreshed in order to return the current data. (Unless I am misunderstanding you.) I think you are probably onto the answer where you mention the saving of the edited records on the form. You might need to do: DoCmd.RunCommand acCmdSaveRecord or: Me.Dirty = False prior to the code that refers to the query. Regards Steve -----Original Message----- From: Darryl Collins Sent: Tuesday, August 31, 2010 2:49 PM To: Access Developers discussion and problem solving Subject: [AccessD] Force Query to recalc using code. Hi Everyone, I am updating a MS Access database that was largely built by someone else. In this database there are lots of pre-built queries, sorted as queries. I seems that a process is failing as I need to force the query to update before the code does something with it. I though I would use query def for this, but I cannot seem to figure out the syntax. Normally I would just call the data I want from a RS using Code, which is always based on the latest data. This query business seems to be a bit flakey in places. Actually it is probably more the way the data is being updated into a bound form, the recordsaved and then the query run that is the issue. Anyway. What I would like is something like "qryMyQuery.Refresh" in the code to force it to update. Advice with this is appreciated. cheers Darryl. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________