i have a table that i use to store control names, comparison criteria, related record I.D.s, field names, etc.
the field names would be: Note_Cntrl, Note_Criteria, Note_ID, Note_Field, etc...
(the different fields are used in different places, in different combinations throughout the project; this is to reduce redundancy in code)
Typical code using these values would be like this:
if you're at control ___, check field ___, in table ___, for this criterion ___
for most records, the criteria is a simple:
...True or False (-1 or 0)
for a select few, the criteria is more difficult:
... InStr(Nz(Forms!frmSpec.controls(strControl_Name), ""), "0-10") > 0 And Forms!frmSpec.chkDimmableYN
the code that this info is fed into would be:
Code:
strNote_Control = gsRst! Note_Cntrl
strNote_Criteria = gsRST!Note_Criteria
if Forms!frmSpec.Controls(strNote_Cntrl) = strNote_Criteria then
... (do something)
This work fine for Boolean criteria;
However, for the more complicated criteria, it’s comparing against the criteria ***as a sting value***, not as an evaluation of that criteria
- How can I deal with the eval of the more difficult criteria?
- Is this an effective approach ?
As always, with thnx in advance,
m.