I have two Buttons, one to select next record and one to select previous one.
the next record works, but the previous one doesn't.
the exact error i get "Operation is not allowed in this context" when i hit debug buttion .MovePrevious gets highlited in yellow which is the problem.
here is the two function that i am using.
i appreciate any help.
Private Sub cmdMoveNext_Click()
With Rs1
If Not .EOF Then
txtoutput.Text = Rs1.Fields(0)
txtpatent.Text = Rs1.Fields(1)
txtserial.Text = Rs1.Fields(2)
listbox.AddItem Rs1.Fields(0)
.MoveNext
Else
MsgBox ("End of File"
End If
End With
End Sub
Private Sub cmdMovePrev_Click()
With Rs1
If Not .BOF Then
txtoutput.Text = Rs1.Fields(0)
txtpatent.Text = Rs1.Fields(1)
txtserial.Text = Rs1.Fields(2)
.MovePrevious // here is the problem //
Else
MsgBox ("Begning of File"
End If
End With
End Sub
the next record works, but the previous one doesn't.
the exact error i get "Operation is not allowed in this context" when i hit debug buttion .MovePrevious gets highlited in yellow which is the problem.
here is the two function that i am using.
i appreciate any help.
Private Sub cmdMoveNext_Click()
With Rs1
If Not .EOF Then
txtoutput.Text = Rs1.Fields(0)
txtpatent.Text = Rs1.Fields(1)
txtserial.Text = Rs1.Fields(2)
listbox.AddItem Rs1.Fields(0)
.MoveNext
Else
MsgBox ("End of File"
End If
End With
End Sub
Private Sub cmdMovePrev_Click()
With Rs1
If Not .BOF Then
txtoutput.Text = Rs1.Fields(0)
txtpatent.Text = Rs1.Fields(1)
txtserial.Text = Rs1.Fields(2)
.MovePrevious // here is the problem //
Else
MsgBox ("Begning of File"
End If
End With
End Sub