Requery needed twice

  • Thread starter Thread starter Kruppy
  • Start date Start date
K

Kruppy

I wrote a name seach routine to be sure a new name is not already in the
table. This routine changes a code, if necessary, so that the query in the
main table will include this record. My problem is that when I do a requery
it doesn't find the record unless I do this:

Me.Recordset.Requery
MsgBox ("delay a few seconds")
Me.Recordset.Requery
Me.Recordset.FindFirst "Name_ID = " & IDmode

without the 2 calls to requery (separated with the msgbox delay) the call to
FindFirst is not successful.
 
the DoEvents statement yeilds your code to other pending processes and can be
strategically placed to keep your code from "getting ahead of itself"

Me.Recordset.Requery
DoEvents
Me.Recordset.FindFirst ...


I'm not positive this is looking for, but it may work. I've also seen it
used as so...

DoEvents: DoEvents: DoEvents

.... for a particularly intensive event (it's like any reset button... once
just isn't enough sometimes),

or like so:

While Len(Dir(strFileName)) <> 0
Kill strFileName
DoEvents
Wend

the above makes sure subsequent code does not run until the system finally
fully gets rid of the file...

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top