Glitchy code

N

Naz

Hi

I've been given a database to manage and update....but one of the forms i
have moved to the new database, a rudimentary search form doesn't seem to
work properly. Its a simple form with first name surname and address unbound
text fields etc...that the user populates and clicks a Find button....a new
form opens up with the results......but for some reason it works fine on the
old database but on the new one it won't work unless i hit return or move to
another field after putting in a name or address. If i just type a name and
click the find button it simply brings up nothing.....i've tried to debug the
code and found that even if something is put in a field it doesn't seem to
register on the FieldName <>"" part of the code
The only change i made to the code was to change some field names...


Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click


filt = doFilter()

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub

-------------------------------------------------------------------------

Private Function doFilter() As String

Dim filt_string As String
Dim WildCardIt As String
Dim TestPot As String


If Wildcard = 0 Then
WildCardIt = "*"
Else
WildCardIt = ""
End If


If Me.FAMILY_NAME <> "" Then
MsgBox "something here"
Me.FAMILY_NAME = WildCardIt & Me.FAMILY_NAME & WildCardIt
filt_string = filt_string + "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"
End If

If Me.FIRST_NAME <> "" Then
Me.FIRST_NAME = WildCardIt & Me.FIRST_NAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[FIRST_NAME] Like
[Forms]![frm_Search_Page]![FIRST_NAME]"
End If

If Me.SURNAME <> "" Then
Me.SURNAME = WildCardIt & Me.SURNAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[SURNAME] Like
[Forms]![frm_Search_Page]![SURNAME]"
End If

If Me.PERSREF <> "" Then
Me.PERSREF = Me.PERSREF & WildCardIt
do_and filt_string
filt_string = filt_string + "[PERSREF] Like
[Forms]![frm_Search_Page]![PERSREF] "
End If

If Me.OPEN_DATE <> "" Then
Me.OPEN_DATE = WildCardIt & Me.OPEN_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[OPEN_DATE] Like
[Forms]![frm_Search_Page]![OPEN_DATE] "
End If

If Me.CLOSE_DATE <> "" Then
Me.CLOSE_DATE = WildCardIt & Me.CLOSE_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[CLOSE_DATE] Like
[Forms]![frm_Search_Page]![CLOSE_DATE] "
End If

If Me.ADDRESS <> "" Then
Me.ADDRESS = WildCardIt & Me.ADDRESS & WildCardIt
do_and filt_string
filt_string = filt_string + "[ADDRESS] Like
[Forms]![frm_Search_Page]![ADDRESS] "
End If

If Me.ACCESSION_NUMBER <> "" Then
Me.ACCESSION_NUMBER = WildCardIt & Me.ACCESSION_NUMBER & WildCardIt
do_and filt_string
filt_string = filt_string + "[ACCESSION_NUMBER] Like
[Forms]![frm_Search_Page]![ACCESSION_NUMBER] "
End If

If Me.RMS_FILE_REF <> "" Then
Me.RMS_FILE_REF = WildCardIt & Me.RMS_FILE_REF & WildCardIt
do_and filt_string
filt_string = filt_string + "[RMS_FILE_REF] Like
[Forms]![frm_Search_Page]![RMS_FILE_REF] "
End If


doFilter = filt_string

End Function

________________________________________________________

Private Sub do_and(ByRef str As String)
If str <> "" Then
str = str + " And "
End If
End Sub



All help is greatly appreciated
 
S

Steve Sanford

The first thing you should do is open the code window , goto TOOLS/OPTIONS,
and in the Editor tab, uncheck the first box "Auto Syntax Check" and put a
check in the second box "Require Variable Declaration".

This will add a line at the top of every code page you create *after* you
check the box. The first two lines of every code page should be:

Option Compare Database
Option Explicit


In Private Sub FINDRECORDS_Click(), you have a line " filt = doFilter()",
but "filt" is not delcared (DIM'ed) anywhere.

To help in debugging, change the sub FINDRECORDS_Click() to look like this:

'----------------------------------
Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click

Dim file as string '<<== added

filt = doFilter()

' for debugging. remove later
Msgbox filt

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub
'----------------------------------

Next , in the function "doFilter()", replace all of the "+" with "&".

From Help: "When you use the + operator, you may not be able to determine
whether addition or string concatenation will occur. Use the & operator for
concatenation to eliminate ambiguity and provide self-documenting code."

You need to declare (DIM) rstado as an ADOB.Recordset.

In the If() function, you can delete all of the lines except "WildCardIt =
"*". You only use "WildCardIt" to hold the "*".

You cannot use a line that is like this:

...= filt_string & "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"

The referenct to the control on the form MUST be outside of the quotes.
Otherwise, the reference is treated like any other text. And you must use the
proper delimiters. For a string, you need to use:

....& "[FAMILY_NAME] Like '" & [Forms]![frm_Search_Page]![FAMILY_NAME] & "'"

or

....& "[FAMILY_NAME] Like '" & Me.[FAMILY_NAME] & "'"

Expanded, it is

Like ' " & Me.[FAMILY_NAME] & " ' "

You will get an error if there is a single quote in the last name (O'Brian),
so you need to check for that also.

If you have fields that are defined as type "Date/Time", they require the #
delimiter. Example:

filt_string = filt_string & "[CLOSE_DATE] Like #" & Me.[CLOSE_DATE] & "#"


To check if there is an entry in a control, I prefer to use:
If Len(Me.FAMILY_NAME) > 0 Then

instead of

If Me.FAMILY_NAME <> "" Then

The Len() function will return 0 for NULLs as well as empty strings ("").


When the search is working, you can delete of comment out the line

Msgbox filt



HTH ..... post back if you still have problems


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Naz said:
Hi

I've been given a database to manage and update....but one of the forms i
have moved to the new database, a rudimentary search form doesn't seem to
work properly. Its a simple form with first name surname and address unbound
text fields etc...that the user populates and clicks a Find button....a new
form opens up with the results......but for some reason it works fine on the
old database but on the new one it won't work unless i hit return or move to
another field after putting in a name or address. If i just type a name and
click the find button it simply brings up nothing.....i've tried to debug the
code and found that even if something is put in a field it doesn't seem to
register on the FieldName <>"" part of the code
The only change i made to the code was to change some field names...


Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click


filt = doFilter()

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub

-------------------------------------------------------------------------

Private Function doFilter() As String

Dim filt_string As String
Dim WildCardIt As String
Dim TestPot As String


If Wildcard = 0 Then
WildCardIt = "*"
Else
WildCardIt = ""
End If


If Me.FAMILY_NAME <> "" Then
MsgBox "something here"
Me.FAMILY_NAME = WildCardIt & Me.FAMILY_NAME & WildCardIt
filt_string = filt_string + "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"
End If

If Me.FIRST_NAME <> "" Then
Me.FIRST_NAME = WildCardIt & Me.FIRST_NAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[FIRST_NAME] Like
[Forms]![frm_Search_Page]![FIRST_NAME]"
End If

If Me.SURNAME <> "" Then
Me.SURNAME = WildCardIt & Me.SURNAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[SURNAME] Like
[Forms]![frm_Search_Page]![SURNAME]"
End If

If Me.PERSREF <> "" Then
Me.PERSREF = Me.PERSREF & WildCardIt
do_and filt_string
filt_string = filt_string + "[PERSREF] Like
[Forms]![frm_Search_Page]![PERSREF] "
End If

If Me.OPEN_DATE <> "" Then
Me.OPEN_DATE = WildCardIt & Me.OPEN_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[OPEN_DATE] Like
[Forms]![frm_Search_Page]![OPEN_DATE] "
End If

If Me.CLOSE_DATE <> "" Then
Me.CLOSE_DATE = WildCardIt & Me.CLOSE_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[CLOSE_DATE] Like
[Forms]![frm_Search_Page]![CLOSE_DATE] "
End If

If Me.ADDRESS <> "" Then
Me.ADDRESS = WildCardIt & Me.ADDRESS & WildCardIt
do_and filt_string
filt_string = filt_string + "[ADDRESS] Like
[Forms]![frm_Search_Page]![ADDRESS] "
End If

If Me.ACCESSION_NUMBER <> "" Then
Me.ACCESSION_NUMBER = WildCardIt & Me.ACCESSION_NUMBER & WildCardIt
do_and filt_string
filt_string = filt_string + "[ACCESSION_NUMBER] Like
[Forms]![frm_Search_Page]![ACCESSION_NUMBER] "
End If

If Me.RMS_FILE_REF <> "" Then
Me.RMS_FILE_REF = WildCardIt & Me.RMS_FILE_REF & WildCardIt
do_and filt_string
filt_string = filt_string + "[RMS_FILE_REF] Like
[Forms]![frm_Search_Page]![RMS_FILE_REF] "
End If


doFilter = filt_string

End Function

________________________________________________________

Private Sub do_and(ByRef str As String)
If str <> "" Then
str = str + " And "
End If
End Sub



All help is greatly appreciated

--

_______________________
Naz,
London
 
S

Steve Sanford

I got bit by the "Cut and paste" bug.

Please disregard the line:

You need to declare (DIM) rstado as an ADOB.Recordset.


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Steve Sanford said:
The first thing you should do is open the code window , goto TOOLS/OPTIONS,
and in the Editor tab, uncheck the first box "Auto Syntax Check" and put a
check in the second box "Require Variable Declaration".

This will add a line at the top of every code page you create *after* you
check the box. The first two lines of every code page should be:

Option Compare Database
Option Explicit


In Private Sub FINDRECORDS_Click(), you have a line " filt = doFilter()",
but "filt" is not delcared (DIM'ed) anywhere.

To help in debugging, change the sub FINDRECORDS_Click() to look like this:

'----------------------------------
Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click

Dim file as string '<<== added

filt = doFilter()

' for debugging. remove later
Msgbox filt

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub
'----------------------------------

Next , in the function "doFilter()", replace all of the "+" with "&".

From Help: "When you use the + operator, you may not be able to determine
whether addition or string concatenation will occur. Use the & operator for
concatenation to eliminate ambiguity and provide self-documenting code."

You need to declare (DIM) rstado as an ADOB.Recordset.

In the If() function, you can delete all of the lines except "WildCardIt =
"*". You only use "WildCardIt" to hold the "*".

You cannot use a line that is like this:

...= filt_string & "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"

The referenct to the control on the form MUST be outside of the quotes.
Otherwise, the reference is treated like any other text. And you must use the
proper delimiters. For a string, you need to use:

...& "[FAMILY_NAME] Like '" & [Forms]![frm_Search_Page]![FAMILY_NAME] & "'"

or

...& "[FAMILY_NAME] Like '" & Me.[FAMILY_NAME] & "'"

Expanded, it is

Like ' " & Me.[FAMILY_NAME] & " ' "

You will get an error if there is a single quote in the last name (O'Brian),
so you need to check for that also.

If you have fields that are defined as type "Date/Time", they require the #
delimiter. Example:

filt_string = filt_string & "[CLOSE_DATE] Like #" & Me.[CLOSE_DATE] & "#"


To check if there is an entry in a control, I prefer to use:
If Len(Me.FAMILY_NAME) > 0 Then

instead of

If Me.FAMILY_NAME <> "" Then

The Len() function will return 0 for NULLs as well as empty strings ("").


When the search is working, you can delete of comment out the line

Msgbox filt



HTH ..... post back if you still have problems


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Naz said:
Hi

I've been given a database to manage and update....but one of the forms i
have moved to the new database, a rudimentary search form doesn't seem to
work properly. Its a simple form with first name surname and address unbound
text fields etc...that the user populates and clicks a Find button....a new
form opens up with the results......but for some reason it works fine on the
old database but on the new one it won't work unless i hit return or move to
another field after putting in a name or address. If i just type a name and
click the find button it simply brings up nothing.....i've tried to debug the
code and found that even if something is put in a field it doesn't seem to
register on the FieldName <>"" part of the code
The only change i made to the code was to change some field names...


Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click


filt = doFilter()

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub

-------------------------------------------------------------------------

Private Function doFilter() As String

Dim filt_string As String
Dim WildCardIt As String
Dim TestPot As String


If Wildcard = 0 Then
WildCardIt = "*"
Else
WildCardIt = ""
End If


If Me.FAMILY_NAME <> "" Then
MsgBox "something here"
Me.FAMILY_NAME = WildCardIt & Me.FAMILY_NAME & WildCardIt
filt_string = filt_string + "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"
End If

If Me.FIRST_NAME <> "" Then
Me.FIRST_NAME = WildCardIt & Me.FIRST_NAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[FIRST_NAME] Like
[Forms]![frm_Search_Page]![FIRST_NAME]"
End If

If Me.SURNAME <> "" Then
Me.SURNAME = WildCardIt & Me.SURNAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[SURNAME] Like
[Forms]![frm_Search_Page]![SURNAME]"
End If

If Me.PERSREF <> "" Then
Me.PERSREF = Me.PERSREF & WildCardIt
do_and filt_string
filt_string = filt_string + "[PERSREF] Like
[Forms]![frm_Search_Page]![PERSREF] "
End If

If Me.OPEN_DATE <> "" Then
Me.OPEN_DATE = WildCardIt & Me.OPEN_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[OPEN_DATE] Like
[Forms]![frm_Search_Page]![OPEN_DATE] "
End If

If Me.CLOSE_DATE <> "" Then
Me.CLOSE_DATE = WildCardIt & Me.CLOSE_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[CLOSE_DATE] Like
[Forms]![frm_Search_Page]![CLOSE_DATE] "
End If

If Me.ADDRESS <> "" Then
Me.ADDRESS = WildCardIt & Me.ADDRESS & WildCardIt
do_and filt_string
filt_string = filt_string + "[ADDRESS] Like
[Forms]![frm_Search_Page]![ADDRESS] "
End If

If Me.ACCESSION_NUMBER <> "" Then
Me.ACCESSION_NUMBER = WildCardIt & Me.ACCESSION_NUMBER & WildCardIt
do_and filt_string
filt_string = filt_string + "[ACCESSION_NUMBER] Like
[Forms]![frm_Search_Page]![ACCESSION_NUMBER] "
End If

If Me.RMS_FILE_REF <> "" Then
Me.RMS_FILE_REF = WildCardIt & Me.RMS_FILE_REF & WildCardIt
do_and filt_string
filt_string = filt_string + "[RMS_FILE_REF] Like
[Forms]![frm_Search_Page]![RMS_FILE_REF] "
End If


doFilter = filt_string

End Function

________________________________________________________

Private Sub do_and(ByRef str As String)
If str <> "" Then
str = str + " And "
End If
End Sub



All help is greatly appreciated

--

_______________________
Naz,
London
 
N

Naz

Hi Steve

Thanks for your help but it still didn't solve the problem.....eventually
though i did find out what the problem was.....instead of using a command
button to launch the search i had created a (better than command button
looking) label and attached the code to its on click event....i don't know
why that should be the problem....but i fixed it by using setfocus to move to
a dummy invisible field...then letting the code run......that worked.....

.....having said that your post miraculously solved 3 other problems....1)
Searching with names that have ' in them 2) the usage of # for open and
close date 3) and oddly your code for 1 helped me with a code problem i
have been having in excel for like 3 months.

So many many thanks :)

Naz

--

_______________________
Naz,
London


Steve Sanford said:
The first thing you should do is open the code window , goto TOOLS/OPTIONS,
and in the Editor tab, uncheck the first box "Auto Syntax Check" and put a
check in the second box "Require Variable Declaration".

This will add a line at the top of every code page you create *after* you
check the box. The first two lines of every code page should be:

Option Compare Database
Option Explicit


In Private Sub FINDRECORDS_Click(), you have a line " filt = doFilter()",
but "filt" is not delcared (DIM'ed) anywhere.

To help in debugging, change the sub FINDRECORDS_Click() to look like this:

'----------------------------------
Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click

Dim file as string '<<== added

filt = doFilter()

' for debugging. remove later
Msgbox filt

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub
'----------------------------------

Next , in the function "doFilter()", replace all of the "+" with "&".

From Help: "When you use the + operator, you may not be able to determine
whether addition or string concatenation will occur. Use the & operator for
concatenation to eliminate ambiguity and provide self-documenting code."

You need to declare (DIM) rstado as an ADOB.Recordset.

In the If() function, you can delete all of the lines except "WildCardIt =
"*". You only use "WildCardIt" to hold the "*".

You cannot use a line that is like this:

...= filt_string & "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"

The referenct to the control on the form MUST be outside of the quotes.
Otherwise, the reference is treated like any other text. And you must use the
proper delimiters. For a string, you need to use:

...& "[FAMILY_NAME] Like '" & [Forms]![frm_Search_Page]![FAMILY_NAME] & "'"

or

...& "[FAMILY_NAME] Like '" & Me.[FAMILY_NAME] & "'"

Expanded, it is

Like ' " & Me.[FAMILY_NAME] & " ' "

You will get an error if there is a single quote in the last name (O'Brian),
so you need to check for that also.

If you have fields that are defined as type "Date/Time", they require the #
delimiter. Example:

filt_string = filt_string & "[CLOSE_DATE] Like #" & Me.[CLOSE_DATE] & "#"


To check if there is an entry in a control, I prefer to use:
If Len(Me.FAMILY_NAME) > 0 Then

instead of

If Me.FAMILY_NAME <> "" Then

The Len() function will return 0 for NULLs as well as empty strings ("").


When the search is working, you can delete of comment out the line

Msgbox filt



HTH ..... post back if you still have problems


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Naz said:
Hi

I've been given a database to manage and update....but one of the forms i
have moved to the new database, a rudimentary search form doesn't seem to
work properly. Its a simple form with first name surname and address unbound
text fields etc...that the user populates and clicks a Find button....a new
form opens up with the results......but for some reason it works fine on the
old database but on the new one it won't work unless i hit return or move to
another field after putting in a name or address. If i just type a name and
click the find button it simply brings up nothing.....i've tried to debug the
code and found that even if something is put in a field it doesn't seem to
register on the FieldName <>"" part of the code
The only change i made to the code was to change some field names...


Private Sub FINDRECORDS_Click()
On Error GoTo Err_FINDRECORDS_Click


filt = doFilter()

DoCmd.OpenForm "frm_ReturnSearchResults", , , filt


Exit_FINDRECORDS_Click:
Exit Sub

Err_FINDRECORDS_Click:
MsgBox Err.Description
Resume Exit_FINDRECORDS_Click

End Sub

-------------------------------------------------------------------------

Private Function doFilter() As String

Dim filt_string As String
Dim WildCardIt As String
Dim TestPot As String


If Wildcard = 0 Then
WildCardIt = "*"
Else
WildCardIt = ""
End If


If Me.FAMILY_NAME <> "" Then
MsgBox "something here"
Me.FAMILY_NAME = WildCardIt & Me.FAMILY_NAME & WildCardIt
filt_string = filt_string + "[FAMILY_NAME] Like
[Forms]![frm_Search_Page]![FAMILY_NAME]"
End If

If Me.FIRST_NAME <> "" Then
Me.FIRST_NAME = WildCardIt & Me.FIRST_NAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[FIRST_NAME] Like
[Forms]![frm_Search_Page]![FIRST_NAME]"
End If

If Me.SURNAME <> "" Then
Me.SURNAME = WildCardIt & Me.SURNAME & WildCardIt
do_and filt_string
filt_string = filt_string + "[SURNAME] Like
[Forms]![frm_Search_Page]![SURNAME]"
End If

If Me.PERSREF <> "" Then
Me.PERSREF = Me.PERSREF & WildCardIt
do_and filt_string
filt_string = filt_string + "[PERSREF] Like
[Forms]![frm_Search_Page]![PERSREF] "
End If

If Me.OPEN_DATE <> "" Then
Me.OPEN_DATE = WildCardIt & Me.OPEN_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[OPEN_DATE] Like
[Forms]![frm_Search_Page]![OPEN_DATE] "
End If

If Me.CLOSE_DATE <> "" Then
Me.CLOSE_DATE = WildCardIt & Me.CLOSE_DATE & WildCardIt
do_and filt_string
filt_string = filt_string + "[CLOSE_DATE] Like
[Forms]![frm_Search_Page]![CLOSE_DATE] "
End If

If Me.ADDRESS <> "" Then
Me.ADDRESS = WildCardIt & Me.ADDRESS & WildCardIt
do_and filt_string
filt_string = filt_string + "[ADDRESS] Like
[Forms]![frm_Search_Page]![ADDRESS] "
End If

If Me.ACCESSION_NUMBER <> "" Then
Me.ACCESSION_NUMBER = WildCardIt & Me.ACCESSION_NUMBER & WildCardIt
do_and filt_string
filt_string = filt_string + "[ACCESSION_NUMBER] Like
[Forms]![frm_Search_Page]![ACCESSION_NUMBER] "
End If

If Me.RMS_FILE_REF <> "" Then
Me.RMS_FILE_REF = WildCardIt & Me.RMS_FILE_REF & WildCardIt
do_and filt_string
filt_string = filt_string + "[RMS_FILE_REF] Like
[Forms]![frm_Search_Page]![RMS_FILE_REF] "
End If


doFilter = filt_string

End Function

________________________________________________________

Private Sub do_and(ByRef str As String)
If str <> "" Then
str = str + " And "
End If
End Sub



All help is greatly appreciated

--

_______________________
Naz,
London
 
Top