Hi,
Is there anybody who has already a good function to correct typing errors in fields such as double spaces between words, a ° or ², or starting a field with a space. This typo's causes the records to be unfindable!
The best way to remove typos is to prevent the user from entering them! I always make the user select from a list if at all possible, select from an Option Group select from anywhere but don't let them type unless it isn't important.
With thought and careful design almost all user input can be predicted. Allow them to add to a list or use the current table as the rowsource of a combo then they see what others have done and it makes them more careful.
It wouldn't be too bad to create a library function that will do stuff like that - I've created a similar function so that someone can enter many different date formats into the box and it will properly recognize them. In the after_update event for the text box, have something like this:
[TextBox] = Lib.CheckText([TextBox])
Then in a module have the function CheckText look something like:
Public Function CheckText(strString As String) As String
Dim intCount As Integer
intCount = 0
Do Until intCount = Len(strString)
If chr(Mid(strString, intCount, 1)) < ...
.....
Look up an ascii table to find out what character values are invalid, which isn't bad because all the valid ones are basically sequential.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.