Hi
Access 2007
Ye Gods does it never end?!
I loop thru' an ADO Rs to update certain fields. Before doing anything I store the ID of the Primary Key (autonum) of the current record. It is stored in a Long variable.
At the end of my loop I want to return to that record.... for which I do i FIND.... sometimes it works, sometimes it doesn't.... when it doesn't I loop around the Rs and msgbox the IDs.... and hey presto there is the record I'm after which the FIND says it can't find. I despair.....
Why is .EOF found but the record is clearly still in the RS? Any Ideas please?
Thanks
Access 2007
Ye Gods does it never end?!
I loop thru' an ADO Rs to update certain fields. Before doing anything I store the ID of the Primary Key (autonum) of the current record. It is stored in a Long variable.
At the end of my loop I want to return to that record.... for which I do i FIND.... sometimes it works, sometimes it doesn't.... when it doesn't I loop around the Rs and msgbox the IDs.... and hey presto there is the record I'm after which the FIND says it can't find. I despair.....
Code:
'Set value
Edit_rstADO![TBL1.List_Order] = Extg_List_Order
'Update Rs
Edit_rstADO.Update
'Now move back to original record
Edit_rstADO.MoveLast } ' desperate efforts to clutch at straws
Edit_rstADO.MoveFirst }
Edit_rstADO.Find "[TBL1.Unique_No]=" & Rec_No_To_Mve_To
If Edit_rstADO.EOF Then
Edit_rstADO.MoveFirst
Do Until Edit_rstADO.EOF
MsgBox Edit_rstADO![TBL1.Unique_No]
Edit_rstADO.MoveNext
Loop
MsgBox "ERROR Can't Find Record " & Rec_No_To_Mve_To
GoTo Err_Move_Field_Up_Button_Click
End If
Thanks