Weird EOF

M

Morten Snedker

Me.RecordSource = "SELECT * FROM vwVVSStikprøve_Hovedmenu"
Set rs = Me.RecordsetClone
rs.Find "esfjnr=" & iJnr
Me.Bookmark = rs.Bookmark

Produces 3021: EOF or BOF on the last line with the Bookmark. EOF is
the case.

If I debug the code and step through the lines one at the time, the
error does not occur, and it bookmarks fine.

The recordset holds +9,000 records, so it could be a question of the
underlying datasource not being ready..couldn't it?

Any ideas as how to get around the problem? I was thinking of a timer
thing, but seems like a not so beautiful solution...

It is an ADP running against SQL-Server 2005, using ADO 2.8.


Regards /Snedker
 
S

Stefan Hoffmann

hi Morten,

Morten said:
Me.RecordSource = "SELECT * FROM vwVVSStikprøve_Hovedmenu"
Set rs = Me.RecordsetClone
rs.Find "esfjnr=" & iJnr
Me.Bookmark = rs.Bookmark

Produces 3021: EOF or BOF on the last line with the Bookmark. EOF is
the case.
From the VB sample in the MSDN:

count = 0
rstTitles.Find "title_id LIKE 'BU%'"

Do While Not rstTitles.EOF
'continue if last find succeeded
Debug.Print "Title ID: "; rstTitles!title_id
'count the last title found
count = count + 1
' note current position
mark = rstTitles.Bookmark
rstTitles.Find "title_id LIKE 'BU%'", 1, adSearchForward, mark
' above code skips current record to avoid finding the same row
' repeatedly;
' last arg (bookmark) is redundant because Find searches from
'current position
Loop
The recordset holds +9,000 records, so it could be a question of the
underlying datasource not being ready..couldn't it?
Delayed loading, why not?


mfG
--> stefan <--
 
R

Robert Morley

There have been reports of odd behaviour with Me.RecordsetClone. Try
instead Me.Recordset.Clone (with the extra dot before Clone). Not sure if
that'll solve the problem at all, but might be worth a try.


Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top