Something like this:
define class GetRange as container
start = null
end = null
add object txtStart as textBox with ControlSource = "this.parent.start", ....
add object txtEnd as textBox with ControlSource= "this.parent.end", ....
*....
enddefine
When reporting:
select ... from ... where someField between thisform.getRange.Start and thisform.getRange.End into cursor crsReport
report form myReport
I built such classes for my search form. The parent class has some base methods, one of them to return Where expression as a string. Each subclass has this method modified. So, when I needed Search functonality I just placed few subclasses on the form, set properties and in form's method concatenated Where expression from these criterion objects.
That's the basic idea, my form didn't even need to know specifics, such as Start/End dates, the validation was also built in.
If you want send me tomorrow an e-mail, I'll send you this classlibrary.
I also have few nice classes in UT Downloads which I used long time ago as Search criteria too. I then re-used it in one of my newer applications (with minor modifications).
Hi Tamar,
See my idea in my message. You don't even need to know what the criterion container is about. It will simply return you a where expression suitable to Search or report FOR clause. Of course, you would have to macro expand which is a disadvantage.