
MovePrevious don't work but the MoveNext work's fine
Hi
Does anyone know which of the CursorTypeEnum allow the moveprevious
method?
Because, I trying to use rs.moveprevious to show the previous record
as the result of this query:
Set Cn = New ADODB.Connection
Cn.ConnectionString = "provider=Microsoft.jet.oledb.4.0;Data Source="
& App.Path & "\gestmail.mdb"
Cn.Open
Set Rs10 = New ADODB.Recordset
Rs10.CursorLocation = adUseClient
Rs10.Open "[principal]", Cn, adOpenDynamic, adLockOptimistic,
adCmdTable
Set Rs10 = Cn.Execute(sqlstr$)
If Not Rs10.EOF Then
numreg = Rs10("reg_actual")
entidade = Rs10("entidade")
departamento = Rs10("departamento")
data = Rs10("data")
datadoc = Rs10("data_doc")
assunto = Rs10("assunto")
natureza = Rs10("natureza")
referencia = Rs10("referencia")
If Rs10("observacoes") <> "" Then
obs = Rs10("observacoes")
End If
Txt1.Text = data
Txt2.Text = numreg
Txt3.Text = departamento
Txt4.Text = entidade
Txt5.Text = referencia
Txt6.Text = datadoc
Txt7.Text = assunto
Txt8.Text = natureza
Txt9.Text = obs
End If
End Sub
Private Sub Cmd1_Click()
if not rs10.EOF then
Rs10.MovePrevious <-- error '3219' Operation is not allowed in this
context
end if
end Sub
Thanks!
Pucca