Expand|Select|Wrap|Line Numbers
- Private Sub btnUpdate_Click()
- Dim sql As String
- Dim A As Database
- Dim rCount As Integer
- Set A = CurrentDb()
- sql = "UPDATE tblTest SET SRoll = " & Me!txtSRoll & ", SName = " & Me!txtSName & " WHERE ID = " & Me!txtID & ""
- A.Execute sql, dbFailOnError
- rCount = A.RecordsAffected
- If rCount > 0 Then
- MsgBox "Contact updated"
- End If
- End Sub
txtSRoll, txtSName, txtID are text boxes and btnUpdate is a command button on the form.
The above code gives me error. Am I missing something??
Note: Using bound forms is a crime in this project.