View Full Version : Access 2007 DoCmd.SearchForRecord


ted.martin
02-04-2009, 01:22 AM
I have a continuous form running in Access 2007 that shows a summary list of various quotations. Double-clicking on any of these opens the full details but when the details close, the following code runs to place the focus on the original record when the form is Activated again.

docmd.requery ' this is there to catch any updates in the details record.

DoCmd.SearchForRecord acDataForm, "F-Quotations Summary", acFirst, "[QuotationNo] = " & intQuotation

My problem is, the DoCmd.SearchForRecord code in Access 2007 and does not run on Access 2003. Does anyone know an Access 2003 solution? I know that removing the docmd.requery will fix it but I really need the requery to run.

thanks

dkinley
02-04-2009, 05:05 AM
Here is Paul's solution (http://www.baldyweb.com/Requery.htm).

-dK

ted.martin
02-04-2009, 05:26 AM
Impressive - well done. My code is one line in Access 2007 but for 2003 will use yours (Pauls') until my client makes the investment in v2007.

Thanks again.

dkinley
02-04-2009, 09:42 AM
Hehe .. not mine, it's all Pauls. My implementations are different and never have needed to use code like that. I only know of that code because I've seen PBaldy link it before and kept it in my head in case I ever needed it - glad you could make use of it.

-dK