Search

  • Thread starter Thread starter Bill
  • Start date Start date
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.
 
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 ??
 
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.
 
Back
Top