I have a form that has text boxes that need to be updated. I am using this code. When I do a mouse over after toggling a breakpoint the rs!whatever seems to be holding the edited value but for some reason the rs.addnew or the rs.update isn't working. Here is my code. Thanks for any help
Private Sub CmdSave_Click()
Dim ssql As String
Dim valdetail As String
Dim rs As Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
With conn
.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Administration;Data Source=SOLOFIND"
.Open
Set rs = New ADODB.Recordset
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
'rs.Open "Resolution", conn, , , adCmdTable
ssql = "Select * from resolution Where res_id = '" & Cmbres.Text & "'"
rs.Open ssql, conn, adOpenKeyset, adLockOptimistic, adCmdText
rs.AddNew
'rs!res_id = "" & TxtRes_id
rs!fname = "" & Txtfname
rs!lname = "" & Txtlname
rs!retailer = "" & txtret
'rs!ProDate = "" & txtdate
'rs!phone = "" & txtphone
rs!detail = "" & txtresolution
'rs!category = "" & txtother
'rs!staff = valstaff
'rs!loggedon_id = frmlogin.val1
'rs!category = valcat
rs!staffdate = "" & txtresolvedate
rs.Update
MsgBox "Datebase Updated"
valdetail = "" & rs!detail
End With
aspvbwannab
Private Sub CmdSave_Click()
Dim ssql As String
Dim valdetail As String
Dim rs As Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
With conn
.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Administration;Data Source=SOLOFIND"
.Open
Set rs = New ADODB.Recordset
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
'rs.Open "Resolution", conn, , , adCmdTable
ssql = "Select * from resolution Where res_id = '" & Cmbres.Text & "'"
rs.Open ssql, conn, adOpenKeyset, adLockOptimistic, adCmdText
rs.AddNew
'rs!res_id = "" & TxtRes_id
rs!fname = "" & Txtfname
rs!lname = "" & Txtlname
rs!retailer = "" & txtret
'rs!ProDate = "" & txtdate
'rs!phone = "" & txtphone
rs!detail = "" & txtresolution
'rs!category = "" & txtother
'rs!staff = valstaff
'rs!loggedon_id = frmlogin.val1
'rs!category = valcat
rs!staffdate = "" & txtresolvedate
rs.Update
MsgBox "Datebase Updated"
valdetail = "" & rs!detail
End With
aspvbwannab