"If rst.EOF Then" statement not working.
Posted on 2006-10-23
I have a problem that has cropped up recently. It seems to be a bug, but someone may have an idea. This code used to work.
'Declarations and recordset population
If rst.EOF Then
Set rst = Nothing
Set myDB = Nothing
rst.MoveNext 'go to next record in recordset,
strDrillhole2 = rst!HOLE_NUMBER 'set strDrillhole2 to HOLE_NUMBER
sngVoid = rst!ASSAY_FROM 'and sngVoid to ASSAY_FROM
'other data processing with goto start calls at various intervals
Basically when the code is getting to the end of the recordset, it is not going into the 'If rst.EOF Then' call, hitting the 'rst.MoveNext' call and coming up with a record not found error at 'strDrillhole2 = rst!HOLE_NUMBER'.
rst.EOF is being set to true, but the If statement is not being triggered. This has got me stuffed.