How to Use SQL- Update Statement

Manage with exercise Premature Ejaculation order viagra cheap can be managed by Erectile Dysfunction Drugs Canada and other medicines. Why to delay in getting the right treatment when you can brand cialis price djpaulkom.tv to fix up the problem instantly. The jelly being packed in jelly format eases out the process of consumption as men need to best prices for cialis simply consume the jelly. Couples expect a lot from each female levitra other in their bedroom for example, a woman wants a man to perform longer and satisfy their partner in bedroom.


SQL- Update Statement

The SQL Update Statement is the SQL code that used to updatet the existing data in a database. It will be used in combination of other VB code. There are few examples of using the SQL –Update Statement below.

SQL UPDATE Syntax

Update a specific record in table:

UPDATE table_name SET field_name  = some_value WHERE  field_name = some_value;

 

#1 Update certain Field on Specific Record

The Update command can be put under the click button to Update a record that is selected from a List Box.

VB Code under a Save button:

Private Sub cmdSave_Click() ' submit button
On Error GoTo ErrHandler:
Dim strUpdate As String
Me.Refresh
If IsNull(Me.Password) Then
      MsgBox "Please enter a new password!", vbInformation, "Data Required!"
Else
strUpdate = "UPDATE tblUser SET Password = '" & Me.Password.Value & "'" _
             & "WHERE (UserID = " & Me.UserID & ")"
     DoCmd.SetWarnings False
     DoCmd.RunSQL strUpdate
     DoCmd.SetWarnings True
     MsgBox "Updated new password successfully", vbInformation, "Password Updated"
     Exit Sub
End If
Exit_ErrHandler:
Exit Sub
ErrHandler:
     MsgBox Err.Description, vbCritical
     Err.Clear
End Sub

update password



Related posts