In Storing Formula, Eric gave me some great advice for storing formulas and computing results. I’ve come up with a user-interface for creating and editing the formulas and I’d like someone to test it out.
As it stands, you can still enter an incorrect formula, but I’ve tried to make is so that only legal characters are available. You could, of course, stop entering the formula without a closing parenthesis and I haven’t attempted to prevent that. But the listbox and commandbuttons are supposed to be disabled when it’s improper to use them. With that in mind, let me know if I missed something.
There are two textboxes; one to hold the formula using the TestID field and one to hold the formula using the Testname field. I’m building these two textboxes simultaneously because I don’t want to convert the TestID formula into the Testname formula every time the formula changes. I fear that it will cause a delay when tests or operators are added or deleted because the conversion won’t be a trivial operation. However, I can see that this simply will not work. If the name of the test is changed, the Testname formula that’s stored will be wrong. I only create and store that formula for display purposes.
TestFormula.zip is an Access 2003 file.