Private Sub QTY_BeforeUpdate(Cancel As Integer)
Dim sSpecialChars As Variant
Dim Cd As String
Cd = Me.QTY
' strip special characters first NEW way
sSpecialChars = "!@#$%^&*()_+={}|[]:;'<>?,.~`"
For i = 1 To Len(sSpecialChars)
Cd = Replace$(Cd, Mid$(sSpecialChars, i, 1), "")
Next
Me.QTY = Cd
End Sub
Trying this but throwing an error:
Private Sub QTY_BeforeUpdate(Cancel As Integer)
You can't update a field while it updates.
Keep in mind that if a bound field is defined as numeric or an unbound field has a numeric format, Access will only allow valid characters to be pasted so a number like 7..00 would create an error and not paste at all.