2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Jx_Man
2

this following code for editing data. change as you needed.

' Edit Query
SQlQuery = "UPDATE Data " & _
           " SET Name ='" & Trim(txtName.Text) & "'," & _
           " Address ='" & Trim(txtAddress.Text) & "'," & _
           " TelpNo ='" & Trim(txtTlpNo.Text) & "'," & _
           " Email ='" & Trim(txtEmail.Text) & "'" & _
           " WHERE Id='" & Trim(txtId.Text) & "'"
            
' Execute Sql query
Con.Execute SQlQuery, , adCmdText
' Message if record already edited
MsgBox "Data Successfully Edited"
0

this following code for editing data. change as you needed.

' Edit Query
SQlQuery = "UPDATE Data " & _
           " SET Name ='" & Trim(txtName.Text) & "'," & _
           " Address ='" & Trim(txtAddress.Text) & "'," & _
           " TelpNo ='" & Trim(txtTlpNo.Text) & "'," & _
           " Email ='" & Trim(txtEmail.Text) & "'" & _
           " WHERE Id='" & Trim(txtId.Text) & "'"
            
' Execute Sql query
Con.Execute SQlQuery, , adCmdText
' Message if record already edited
MsgBox "Data Successfully Edited"
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.