"Sal" <sl*****@bellatlantic.net> wrote in message news:<ay*******************@nwrdny02.gnilink.net>. ..
How can I prevent same characters from being enter in field on a form.
For example "#$%@"
Please Help
Thanks
Slawek
I have used a function to remove the characters on the after update
event of the field
Public Function RemoveChars(strString As String) As String
On Error GoTo RemoveChars_Err
Dim strResult As String
Dim iCtr As Integer
For iCtr = 1 To Len(strString)
Select Case UCase(Mid(strString, iCtr, 1))
Case "#","$","%","@"
'do not add character
Case Else
strResult = strResult & Mid(strString, iCtr, 1)
End Select
Next iCtr
RemoveChars = strResult
RemoveChars_Exit:
Exit Function
RemoveChars_Err:
MsgBox Err.Description, vbInformation, Err.Number
Resume RemoveChars_Exit
End Function