G
Guest
I have an ADP to an SQL database. On a form which shows about 13,000 records
I want to navigate to the last record the current user created, no problem I
just add some code to run in the Load event e.g.
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone
rs.Find "[SpecialID]='" & Nz(sId, "") & "'"
On Error Resume Next
Me.Bookmark = rs.Bookmark
I have found that this doesn't work, basically it takes 3-4 seconds to load
the form with data (I can see '...' to the right of the record navigator
bar), which appears to be done asynchronously to the Load event clode.
Hence this works find for records that are near the top of the form, but for
records towards the end, that are not yet loaded when the 'Me.Bookmark =
rs.Bookmark' executes an error occurs.
Is there a way to determine if the form's recordset is completely loaded
before I do the Find operation, or force it to load synchronosly?
If I assign the Find code to a button and manually do it after the recordset
has loaded, or put a delay in the routine for a few seconds all works as
expected.
Any ideas?
Thanks
Chunda
I want to navigate to the last record the current user created, no problem I
just add some code to run in the Load event e.g.
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone
rs.Find "[SpecialID]='" & Nz(sId, "") & "'"
On Error Resume Next
Me.Bookmark = rs.Bookmark
I have found that this doesn't work, basically it takes 3-4 seconds to load
the form with data (I can see '...' to the right of the record navigator
bar), which appears to be done asynchronously to the Load event clode.
Hence this works find for records that are near the top of the form, but for
records towards the end, that are not yet loaded when the 'Me.Bookmark =
rs.Bookmark' executes an error occurs.
Is there a way to determine if the form's recordset is completely loaded
before I do the Find operation, or force it to load synchronosly?
If I assign the Find code to a button and manually do it after the recordset
has loaded, or put a delay in the routine for a few seconds all works as
expected.
Any ideas?
Thanks
Chunda