Search

B

Bill

Hi

I'm trying to figure it out if there is a possible way to use bincoluar (Find) to search any File Number without hypens or with hypen. Some of them put one hypens or two hypens or No hypens. Will that be possilbe to search with or without hypens by using code ??

eg.
1-2-3
1-23
123

All three means the same.

Your help would be much appreciated.
 
D

Denny G.

Bill, play around with the asterisk (*). Example, in the
Find form, enter this: *-* and you will show only those
records with a "-". Experiment with other combinations
using the asterisk.

Denny G.
-----Original Message-----
Hi

I'm trying to figure it out if there is a possible way to
use bincoluar (Find) to search any File Number without
hypens or with hypen. Some of them put one hypens or
two hypens or No hypens. Will that be possilbe to search
with or without hypens by using code ??
 
P

Phobos

Bill,

Try this function:


'Code Begins
Function replace(fld As String, find As String, Optional repwith As String =
"") As String
Dim fldLen As Long
fldLen = Len(fld)

Dim findLen As Long
findLen = Len(find)

Dim newFld As String
newFld = ""

Dim x As Long
For x = 1 To fldLen
If Mid(fld, x, findLen) = find Then
newFld = newFld & repwith
x = x + findLen - 1
Else
newFld = newFld + Mid(fld, x, 1)
End If
Next

replace = newFld
End Function
'Code ends



In your query, one of the fields should be:

replace([fieldName],"-")

This removes hyphens (the default for the repWith argument is a
zero-length-string).

P


Hi

I'm trying to figure it out if there is a possible way to use bincoluar
(Find) to search any File Number without hypens or with hypen. Some of
them put one hypens or two hypens or No hypens. Will that be possilbe to
search with or without hypens by using code ??

eg.
1-2-3
1-23
123

All three means the same.

Your help would be much appreciated.
 

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