On 1/31/2025 1:29 PM, Charlie wrote: > I am trying to filter on two different fields that are character, but get an error 'expecting logical'. I've tried macros and other things > > How can I get this to work? > > function COMBOBOX1_onChange() > ct = form.category1.rowset > cl = form.collection1.rowset > fltr = trim(ct.fields["cat"].value) > fltr2 = trim(form.combobox1.value) > if trim(form.combobox1.value) = "ALL ERAS" > // trim(form.combobox1.value) > else > msgbox( ""+fltr+" "+fltr2) //filters show correct data in this msgbox. > //fltr2 = "" > cl.filter = [era ='] + fltr2 + ['] and [category ='] + fltr + [']// line that gets the error > endif > form.collection1.requery() > return
I think Heinz is correct.
cl.filter = [era ='] + fltr2 + ['] and [category ='] + fltr + [']//
line that gets the error
The word "and" has to be in the string that is built. You have it
outside of it.
cl.filter = [era ='] + fltr2 + [' and category ='] + fltr + [']// line
that gets the error