Wildcard in the InStr command

G

Guest

I am trying to find and delete sensitive data within a text field. I tried
using wildcard characters in an InStr command to get the starting location
but I always get 0 returned.

Is this right or can I use the wildcards or is there another way.

Thanks,

alr
 
M

Marshall Barton

alr said:
I am trying to find and delete sensitive data within a text field. I tried
using wildcard characters in an InStr command to get the starting location
but I always get 0 returned.

Is this right or can I use the wildcards or is there another way.


InStr doesn't understand wildcards!

Perhaps someone could help if you explained more about what
you need to do.
 
K

Kevin K. Sullivan

InStr does not recognize wildcard characters. Any *, #, or ? you use in the
criterion is going to treated as a literal. Please give an example of what
you are trying to locate within a typical example field.

You can use the Like operator with wild cards.

You could use Regular Expressions to replace text.
Search Google Groups for
rgxReplace "John Nurick"
for his excellent function.

HTH,

Kevin
 
G

Guest

Thanks Kevin. This sounds very close to what I need.

The query I used to ID the records in question used the following criteria:

Like "*acct[#] ###*"
Like "*###-##-####*"

Of course there were other permutations to find Taxpayer and account numbers
but this is the basic theme. I need to delete the sensitive data and leave
the rest as in the cases:

J Smith 123-45-6789
acct# 123456 J Smith

I had planned to use the InStr to find the next space after acct# 123 (start
+ 8) for deletion but if a few trailing digits remain, that may be tolerable.

Since this is a simple identify strings and delete them, is possible that
the update query could be used instead of the more complex code? I am not
certain how to get the update to component to recognize regular expressions.

With a little help getting one of these cases working, I could easily get
through the rest on my own. A little assistance getting started would be much
appreciated.

Thanks,

alr
 

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