Would like to move through my database using .movenext/.moveprevious buttons. However, my code is not cooperating. The error I am getting 'Current Recordset does not support updating' which is error 3251. Haven't a clue on how to cure.
My code:
Public Sub NextRecord(ByVal lngID As Long)
On Error GoTo HandleError
sSql = "SELECT * FROM Members WHERE Members.ID =" & lngID
If rs.State = adStateOpen Then
rs.Close
End If
rs.Open sSql, cData
rs!ID = lngID
With rs
.MoveNext
If .EOF Then
.MoveFirst
End If
End With
hangs up with rs!ID = lngID and returns the error msg.
The connection and recordset are all dimmed in option explicit. No problem opening the recordset.
Any help is appreciated.
Thanx.
Kim
My code:
Public Sub NextRecord(ByVal lngID As Long)
On Error GoTo HandleError
sSql = "SELECT * FROM Members WHERE Members.ID =" & lngID
If rs.State = adStateOpen Then
rs.Close
End If
rs.Open sSql, cData
rs!ID = lngID
With rs
.MoveNext
If .EOF Then
.MoveFirst
End If
End With
hangs up with rs!ID = lngID and returns the error msg.
The connection and recordset are all dimmed in option explicit. No problem opening the recordset.
Any help is appreciated.
Thanx.
Kim