Exclude a character (Apostrophe) in an input field of a form

Rich77

New member
Local time
Today, 17:19
Joined
Dec 26, 2023
Messages
9
In a form, an apostrophe may not be used in an input field (all other characters do not cause a problem). There are 2 options to solve this:
1. If the apostrophe is used, it will automatically be replaced by an underscore (with action "Replace").
2. If the apostrophe is used, a messagebox will warn you: "Apostrophe is not allowed" and you must first use another character.
I can't quite manage to implement either of these options without using a lot of VBA code.
Can anyone help me to solve this easily?
 
Answered in your duplicate post.
 
check for the instr() of the char() or chr() value
 
Many surnames include the apostrophe in certain languages. This isn't a problem if you enclose search strings in double quotes. However, if your string might include double quotes, then you need to use the single. If the string can contain either, then there are techniques posted here for that also.
 

Users who are viewing this thread

Back
Top Bottom