I am using the following code to update a field in a DB. The only problem is I have to hit the key twice for it to work.
Code:
Private Sub txtService_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete Then
        UpdateNote
        
    End If
End Sub
Private Sub txtService_KeyPress(KeyAscii As Integer)
    If KeyAscii = 8 Then
    UpdateNote
    Else
        KeyAscii = 0
    End If
End Sub
Private Sub UpdateNote()
    Dim strSQL As String
    Dim oRS As Recordset
    Dim strName As String
    
         strName = txtCustName
         strSQL = "SELECT  ServiceNotes "
         strSQL = strSQL & "FROM Locations "
         strSQL = strSQL & "WHERE Location = '" & ListView1.SelectedItem & "' And Customer = '" & strName & "'"
         
         Set oRS = New Recordset
         oRS.Open strSQL, goConn, _
                 adOpenKeyset, adLockPessimistic, adCmdText
         
         With oRS
             !ServiceNotes = Str2Field(txtService)
         End With
        oRS.Update
        oRS.Close
    
End Sub
How can I do this?