Originally Posted by
pablo40
Thank you. But my issue is slightly different.
I think I have found answer to my second question, which is how to insert "rs!" prefix at the front of all references to any fields. I think I will make users key in square brackets [] over any field names they will refer to. Then I will use this solution:
Replace(CStr(rs!condition), "[", "rs!["). Thanks to this user will type in: [N1]>12 and it will be converted to "rs![N1]>12". But this is still a string! How can I use it in logical expression such as IF [string] THEN... END IF?
rs is the object - not the field.
the ! is the object class item/element inside the object. Since it is a recordset - you are referring to a field which is <i>inside</i> the object/recordset.
It's the "bucket" that holds the fields. You shouldn't event be using replace() function on it - It won't work because it isn't stored data only what after the rs! is.
You want to evaluate the values inside the object - which is the fields.
Code:
Replace(CStr(rs!condition), "[", "rs![") should be replace(valueToReplace,findmatch,replacewith)
essentially the replace looks inside a string - and returns the same string with the new changes
rs!Field = replace(rs!Field,"removeThisFromValue","toThis")
If you get that part let me know and I see if I can answer the next question.