Dear Fred/Jeff,
I found your post, and like it, but I would very much like to learn more about the "DLookUp" and table for exceptions. I am often in the situation when I am "washing" / converting large amounts of data, in one specific table field "Name". I wish to run a code that would clean the strings to requirements. Typical it could be Proper Case or Centence case, while quite a few of exceptions needs to ignored by the update, such as "FO", or M/E, or "D/G" or "J.C.F.W." Also at the same time conversion from wrong case would be from "A.e" to "AE", A problem that I find sometimes is that the word may be in various positions, sometimes in the beginning, middle or end of a string. So in effect sometimes it is a try and fail to get it right, or as best possible. That is why a "from->to" table (or a simple to edit comma separated text file) would be very helpful, by looking up a value in column1, and replacing with value in column 2. A 3rd column would be nice to be able to turn it on/off with Y/N, in example:
col1, col2, col3
F.O., FO, Y
M/E, ME, Y
J.C.F.W, JCFW, Y
Aux.Engine, AE, Y
Aux Engine, AE, N
Main Engine, ME, Y
etc
today we have a delphi developed program doing it, but the exceptions are "hardcoded", and we have to compile a new program each time we wish to add new exceptions, Here is a sample of that delphi code, here string starting with a space. I think the way it works in that delphi program it first converts to Propercase "everything", and then converts the listed exceptions back to UCASE:
StrReplaceEnd(Tmp, ' G.s.', ' GS');
StrReplaceEnd(Tmp, ' G/s', ' GS');
StrReplaceEnd(Tmp, ' G.w.', ' GW');
StrReplaceEnd(Tmp, ' G/w', ' GW');
StrReplaceEnd(Tmp, ' Hfo', ' HFO');
StrReplaceEnd(Tmp, ' H.f.o.', ' HFO');
StrReplaceEnd(Tmp, ' H.f.o', ' HFO');
StrReplaceEnd(Tmp, ' H/f/o', ' HFO');
Hope you can do some magic, because it would be so much simpler to solve by using Access.
Thanks
Espensu