find & replace

  • Thread starter Thread starter Qslx
  • Start date Start date
Q

Qslx

Hello,
I've been looking for a way to make find&replace action of
whole words within a field.
The point is, through all possible "match" options of the
find&replace dialog box, Access will not make any
distinction finding word ABC within the word ABCDEF
or the word ABC, even if these 2 words belong to the same
record/field ("ABC ABCDEF").
Neither there is (that I know) any built-in function who
may look for whole words within a (multi-words)field.
Can anybody help on this matter?
Thanks you very much.
Qslx
 
Neither there is (that I know) any built-in function who
may look for whole words within a (multi-words)field.

Try the Scripting.RegExp object: this will do global matches and word-
boundary anchors as required.

HTH


Tim F
 
Hello Tim,
I appreciate your suggestion, but... where can I find that
Scripting.RegExp? I've been looking for it in the Help
files from Access, as well as in the Object Browser...
Please forgive me this completely newbie question.

Thanks.
Qslx
 
I've been looking for it in the Help
files from Access, as well as in the Object Browser...

You need to find the help file for the Windows Scripting Host: you may have
to look it up on the microsoft site or in a book on VB Script. You can get
it in the object browser by setting a reference in the vb editor to

Microsoft VBScript Regular Expressions 5.5

and in fact you need to do that in order to use the object anyway. Then you
can simply do:

With re
.Pattern = "^[0-9]*$" ' all digits
fOutcome = .test("0123456789F")

End With

If fOutcome = False Then
MsgBox "That was not all digits"
End If


Please forgive me this completely newbie question.

Not a newbie question at all -- it took me a while to find it in Access!!


All the best

Tim F
 
Back
Top