General information
Category:
Coding, syntax & commands
I put the 'and' before, rather than after. each checkbox-controlled condition, and preceed them all by a condition that is always checked for. If there's none, I just check for .T., as shown below. If there's a performance hit for doing this, I've not noticed it, since I think VFP is smart enough not to evaluate it for every record.
local lcWhere
lcWhere = '.T. '
if this.check1.value
lcwhere = lcWhere + 'and a = b '
endif
if this.check2.value
lcwhere = lcWhere + 'and c = d '
endif
if this.check3.value
lcwhere = lcWhere + 'and e = f '
endif
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only