Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOF or EOF error

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
When I select from a combo box that runs this code I am getting an "Either BOF or EOF is true or the current record has been deleted. What is causing this???



If oRS.State <> adStateOpen Then
oConn.Close
Set oConn = Nothing
Exit Sub
Else
oRS.MoveLast
oRS.MoveFirst
If oRS.RecordCount > 0 Then
'String fields
Me.cmbtype = oRS!FABRIC_TYPE_DESC
Me.txtDescription = oRS!FABRIC_DESC
End If
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing


DoEvents
Exit Sub
'Me.Requery

ErrHandler:
Call ErrorHandler
 
Code:
If oRS.State = adStateOpen Then 'Recordset is open ...
   If Not (oRS.EOF  And  oRS.EOF) '... and NOT empty
      'String fields
      Me.cmbtype = oRS!FABRIC_TYPE_DESC
      Me.txtDescription = oRS!FABRIC_DESC
      oRS.Close  '...close it...
   End If
End If
Set oRS = Nothing '...and destroy it.
If Not oConn Is Nothing Then 'Check for the connection ...
   If oRS.State = adStateOpen Then oConn.Close '...close it...
   Set oConn = Nothing '...destroy it.
End If
DoEvents
Exit Sub
'Me.Requery
    
ErrHandler:
    Call ErrorHandler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top