>Hi Sandi.
>
>>I have a screen that I want to always filter a particular set of records, but allow the user to add more filtering if necessary. I tried adding the rest of the filter to the Filter button on my screen, but it didn't work.
>>
>>in my Click method on the button
>>
>>.oQuery.cFilter = 'BKCHECK.Posted AND ' + .oQuery.CFilter
>
>SFQuery's cFilter property is overwritten by whatever conditions the user enters. Instead, do it like this:
.oQuery.Show()
>lcFilter = 'BKCHECK.Posted' + iif(empty(.oQuery.cFilter), '', ;
> ' AND (' + .oQuery.cFilter + ')')
>set filter to &lcFilter
The reason this code adds ( ) around .oQuery.cFilter is that the user might enter a couple of conditions with an OR between them, so ( ) helps keep the precedence of the operators correct.
>
>Doug
**** Thanks that worked wonderfully!.
Sandi.