A
Alex
I have the following code:
Dim rs As DAO.Recordset
Dim TheLocID As Integer
Set rs = Me.F_LocationsSubForm2.Form.Recordset
If rs.RecordCount = 0 Then
TheLocID = 0
Else
If rs.BOF Or rs.EOF Then
rs.MoveFirst
End If
TheLocID = rs.Fields!LocID ' Error here sometimes
End If
Sometimes I get a "No Current Record" error on the line with "TheLocID =
rsFields!LocID". I am baffled as to why I am getting this error given that I
am already testing for BOF and EOF, and when the error occurs it does even
though both BOF and EOF are False. Furthermore, upon examining the
AbsolutePosition of the recordset it turns out that it's -1. How is this
possible? Given that both BOF and EOF are False, shouldn't the
AbsolutePosition be at least 0?
Dim rs As DAO.Recordset
Dim TheLocID As Integer
Set rs = Me.F_LocationsSubForm2.Form.Recordset
If rs.RecordCount = 0 Then
TheLocID = 0
Else
If rs.BOF Or rs.EOF Then
rs.MoveFirst
End If
TheLocID = rs.Fields!LocID ' Error here sometimes
End If
Sometimes I get a "No Current Record" error on the line with "TheLocID =
rsFields!LocID". I am baffled as to why I am getting this error given that I
am already testing for BOF and EOF, and when the error occurs it does even
though both BOF and EOF are False. Furthermore, upon examining the
AbsolutePosition of the recordset it turns out that it's -1. How is this
possible? Given that both BOF and EOF are False, shouldn't the
AbsolutePosition be at least 0?