By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Distinguish 0 and O's in a string

P: 28
I have a user input where i do a dlookup in a table-->field but there is a need to find the string even if the original field value contains 0 or O and also if the user input contains 0 or O.

ie - CODE1234 (entered with a numeric 0) should find CODE1234 when entered with a Alph 0)
Dec 30 '06 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,597
I have a user input where i do a dlookup in a table-->field but there is a need to find the string even if the original field value contains 0 or O and also if the user input contains 0 or O.

ie - CODE1234 (entered with a numeric 0) should find CODE1234 when entered with a Alph 0)
'Before using the DLookup() Function, you can replace all occurrances of
'the SubString "C0de" with 'Code" as in the example:

Expand|Select|Wrap|Line Numbers
  1. Dim retString As String
  2.  
  3. retString = Replace("jjhyuC0de1234", "C0de", "Code")
  4. Debug.Print retString
retString will now return "jjhyuCode1234" so it can effectively be used with
DLookup() to return the proper result
Dec 31 '06 #2

Expert 5K+
P: 8,435
Quick question - what about other visually similar characters such as 1 (one) and l (lowercase "L")?

And one for the experts - can regular expressions be used in Access? Seems as though they might fit the bill for this kind of thing.
Jan 1 '07 #3

P: 28
Absolutely correct, have now used nested repace() to solve problem for (0's o's) (l's 1's) - thanks.
Jan 1 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.