find & replace

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
 
T

Tim Ferguson

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
 
Q

Qslx

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
 
T

Tim Ferguson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top