Hi Neil,
>Sorry I forgot to mention.
>
>The last part of the syntax that you sent me sets the filter. My field has lots of records and in one of those fields named modacad.key2 I have assigned either Text1, Text2 .....Text5. Therefore in my list box I have selected Text2 and Text5. So when I set the filter it is looking for Text2 and Text5 at the same time. I apply the syntax
>
>SET FILTER FOR INLIST(modacad.key2 &lchelp)
>
>I get a function / argument invalid
>
>By putting a messagebox there it tells me the 2 values i.e. Text2, Text5
>which is great
This could not work because of the missing ',' and Text2 and Text5 need to be strings.
Dont miss the '"' and the comma in the creation of lchelp
if lcHelp is
Text2,Text5
the macro expands to
SET FILTER FOR INLIST(modacad.key2 Text2,Text5)
it should be
SET FILTER FOR INLIST(modacad.key2 ,"Text2","Text5")
>Does this mean that it is looking for both these values in the key2 field.
Yes the filter should include both
modacad.key2="Text2" and modacad.key2="Text5"
>I want it to find records with Text2 and then again with Text5.
If you need it one after the next you have do do something within the loop.
HTH Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]