I have a field on a form (say Title) for which I need to write validation
code. The following values should not be permitted

- Line feed
- CR, CRLF
- single quotes
- double quotes
- trailing black spaces
- leading blank spaces

Is there any such general purpose function already written somewhere...

thanks

Re: string validation by Steve

Steve
Wed Feb 22 13:19:55 CST 2006

abcd wrote:

> I have a field on a form (say Title) for which I need to write validation
> code. The following values should not be permitted
>
> - Line feed
> - CR, CRLF
> - single quotes
> - double quotes
> - trailing black spaces
> - leading blank spaces
>
> Is there any such general purpose function already written somewhere...

Function Validate(x)
With New RegExp
.Pattern = "^ | $|.*[\n\r'""].*"
Validate = Not .Test(x)
End With
End Function

--
Steve

Never explain--your friends don't need it, and your enemies won't
believe you anyhow. -Elbert Hubbard