I wrote code
Private Sub cmdok_Click()
Dim rs As New ADODB.Recordset
Dim strSql As String
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.CursorType = adOpenDynamic
strSql = "SELECT * FROM tb_absensi " & _
" WHERE nrp='" & cmbnrp & "'" & _
" AND tanggal = " & CDate(lbltgl.Caption)
rs.Open strSql, Conn
MsgBox rs.RecordCount
Select Case cmbstatus
Case "Masuk"
rs.AddNew
rs!nrp = cmbnrp
rs!masuk = Label6.Caption
rs!tanggal = lbltgl.Caption
rs.Update
rs.Open strSql, Conn
Case "Pulang"
rs.Open strSql, Conn
rs!pulang = Label6.Caption
rs.Update
End Select
Unload Me
End Sub
when I run the scrip, appear error "run-time error 3705 Operation is not allowed when the object is open"
please help me, what should I do to make it run properly
Thanks before