[code=vb]
Private Sub cmdEdit_Click()
mName = Trim(ListView1. SelectedItem)
mesge = MsgBox("Are you Sure you Want to Update " & mName & "?", vbOKCancel, "ERROR")
'=MsgBox "You have selected the employee" & mName & "Continue", vbOKCancel, "PAYROLL"
If mesge = vbOK Then
rs.Open "select * from empdetail where name = '" & mName & "'", conn, adOpenStatic, adLockOptimisti c
Form1.txtid.Tex t = rs!id
Form1.txtname.T ext = rs!Name
Form1.txtwhr.Te xt = rs!whours
Form1.txtrate.T ext = rs!Rate
Form1.txtorate. Text = rs!otrate
txtid.Enabled = False
'txtname.SetFoc us
Form1.txtname.S etFocus
rs.Close
Set rs = Nothing
Else
conn.Execute "update empdetail set Name= '" & txtname & "',whours=' " & txtwhrs & "',rate ='" & txtrate & "',otrate ='" & txtorate & "'"
MsgBox "UPDATED NEW DETAILS", vbOKOnly, "UPDATED RECORDS"
End If
[/code]
the code above is to update the fields other than id in aparticular form,please go thru it,that is not working???
Private Sub cmdEdit_Click()
mName = Trim(ListView1. SelectedItem)
mesge = MsgBox("Are you Sure you Want to Update " & mName & "?", vbOKCancel, "ERROR")
'=MsgBox "You have selected the employee" & mName & "Continue", vbOKCancel, "PAYROLL"
If mesge = vbOK Then
rs.Open "select * from empdetail where name = '" & mName & "'", conn, adOpenStatic, adLockOptimisti c
Form1.txtid.Tex t = rs!id
Form1.txtname.T ext = rs!Name
Form1.txtwhr.Te xt = rs!whours
Form1.txtrate.T ext = rs!Rate
Form1.txtorate. Text = rs!otrate
txtid.Enabled = False
'txtname.SetFoc us
Form1.txtname.S etFocus
rs.Close
Set rs = Nothing
Else
conn.Execute "update empdetail set Name= '" & txtname & "',whours=' " & txtwhrs & "',rate ='" & txtrate & "',otrate ='" & txtorate & "'"
MsgBox "UPDATED NEW DETAILS", vbOKOnly, "UPDATED RECORDS"
End If
[/code]
the code above is to update the fields other than id in aparticular form,please go thru it,that is not working???
Comment