Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a Conditional Variable
Message
From
02/09/2008 09:29:14
 
 
To
02/09/2008 09:04:22
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344079
Message ID:
01344102
Views:
11
>I have a variable, m.FilterCondition, that is built as criteria is selected on the form. For example:
>
>m.FilterConditon = m.FilterCondition + " AND SomeValue = SomeOtherValue01"
>
>This works great until the same condition is selected again:
>
>m.FilterConditon = m.FilterCondition + " AND SomeValue = SomeOtherValue02"
>
>Now m.FilterCondition has both clauses, which causes problems. How can I ensure that I have a good conditional variable?

I use checkboxes. In InterActiveChange I set a property of the checkbox, something like this
If this.value=1
  cFilter=' somefilter '
else
  cFilter='.T.'
endif
Thisform.Setfilter()
Thisform.Setfilter:
Thisform.cFilter=thisform.chbCond1.cFilter + ' and '  + thisform.chbCond2.cFilter + ' and ' +  thisform.chbCond1.cFilter
Set filter to &thisform.cFilter
Previous
Reply
Map
View

Click here to load this message in the networking platform