uronmapu > 25-07-12, 12:44 PM
uronmapu > 25-07-12, 02:55 PM
Noname > 25-07-12, 03:58 PM
Private Sub cmdUpdate_Click()
On Error GoTo err
CurrentDb.Execute " UPDATE tblNames SET First = '" & Me.First & "' WHERE RecordID = " & Me.RecordID
CurrentDb.Execute " UPDATE tblNames SET Last = '" & Me.LAst & "' WHERE RecordID = " & Me.RecordID
DoCmd.Close acForm, Me.Name
Exit Sub
err:
If err.Number = 3075 Then
MsgBox "ban da nhap vao mot ky tu dac biet vao fistname hoac lastname, vui long nhap lai gia tri 0-9, a-z", , "Thong bao"
Else
MsgBox "ban bi loi " & err.Number & ":" & err.Description & Chr(13) & " Vui long lien he Admin ve loi nay"
End If
End Sub
uronmapu > 25-07-12, 04:13 PM
uronmapu > 25-07-12, 04:30 PM
Noname > 25-07-12, 05:16 PM
Function ReplaceS(s As String) As String
ReplaceS = Replace(s, "'", "''")
End Function
Private Sub cmdUpdate_Click()
CurrentDb.Execute " UPDATE tblNames SET tblNames.[First] = '" & ReplaceS(Me.First) & "' WHERE tblNames.[RecordID] = " & Me.[RecordID]
CurrentDb.Execute " UPDATE tblNames SET tblNames.[Last] = '" & ReplaceS(Me.LAst) & "' WHERE tblNames.[RecordID] = " & Me.[RecordID]
DoCmd.Close acForm, Me.Name
End Sub
uronmapu > 25-07-12, 05:31 PM
Function ReplaceS(s As String) As String
ReplaceS = Replace(s, "'", "''")
End Function
Noname > 25-07-12, 06:08 PM
[First] = '''
uronmapu > 25-07-12, 06:25 PM