getting and storing data using absolute value (1 Viewer)

PWG

Registered User.
Local time
Today, 10:24
Joined
Jun 13, 2019
Messages
56
I am not sure where to ask this question.
I have a table called parts
a field in that table called part number, this is a text field
The part number from my suppliers can be any format ie;
245-678-00, 8W-957, 89 07 68, 568.897.RB

When some one enters a new part if they do not get the - . or the spaces in the correct places it is impossible to locate the part in a search. It is also possible to enter the same part number 2 x with different format
Is there a way to save and look up only the values and not the - . or spaces no mater what the user inputs.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:24
Joined
May 7, 2009
Messages
19,229
use Replace function in the search:
Code:
DLookup("fieldToReturn", "tableName", 
   "Replace(Replace(Replace(SearchField,'.', ''), ' ', '') , '-', '')='" &
      Replace(Replace(Replace(txtSearchFor, '.', ''), ' ', ''), '-', '') & "'")
 

Users who are viewing this thread

Top Bottom