>>>BTW guys. Sorry, but the code is not in the form's .Init(), but in a method that fires when the Operator is changed (i.e. getting all the bus routes that apply to a part. bus operator).
>>>
>>>I must be going snow-blind
>>
>>What if you move SET FILTER command (if you really need to use it) outside the WITH ENDWITH ?
>
>Well this is the thing now. I've replace the thisform.dStartDate with ldDate in this code, now I'm back to square one in that when I drop ythe combo (1st time) I get message that ldDate not known. Trouble is that code is supposed to fire when I change the operator (also via combo); this isn't happening when I drop the Route combo.
>
>The filter assignment is now simply:
>
> lcFilter = "OPERATOR = " + ALLTRIM( STR( lnOperator)) + " and " + ;
> "END_DATE >= ldDate or EMPTY( END_DATE)"
>
>
>Can't figure why this fires at this point cos, as I said, I'm not changing the operator.
Because you have to put it as a constant, not the ldDate variable as you show here. See my other reply to Borislav (cc to you) a sec. ago.
If it's not broken, fix it until it is.
My Blog