Actually two questions. They both involve the same form. And I’ve scoured through the Forum (usually without logging in) to no avail. So here are my questions.
Math with variable values won’t work since they are text, right? For instance, “myCredit - myDebit” produces a type mismatch. However the following works fine, and will display either a positive or negative number in a TD object depending on the underlying values. Example: “$234.56” OR “- $234.56”.
Pattern(arraynumerictotal(myCredit, ¶) - arraynumerictotal(myDebit, ¶), “$#,.##”)
However, I want to display any negative result in color using ?( true/false in a form TD object. The following DOES NOT work. It displays a positive value correctly and for a negative value the result is an error – “cannot subtract a number from text”. So the question is, how to display a negative value in color? I’ve tried several variations on the following, including omitting the Pattern( function .
?(Pattern(arraynumerictotal(myCredit, ¶) - arraynumerictotal(myDebit, ¶), “$#,.##”) <0,
“color:FF0000” + Pattern(arraynumerictotal(myCredit, ¶) - arraynumerictotal(myDebit, ¶), “$#,.##”), Pattern(arraynumerictotal(myCredit, ¶) - arraynumerictotal(myDebit, ¶), “$#,.##”))
{“color:FF0000" +} seems to be the culprit. It chokes at the “+” sign.
Second Question:
A PopUp menu listing choices of Months is blank when the form is opened with .Initialize even though the variable ‘monthList’ is declared in the procedure. A msg stmt at the end of .Initialize confirms that is correct.
monthList = datepattern(TransactionDate, “MONTH YYYY”)
Upon form opening, all 20+ TD objects show their text or numeric values and totals correctly. But the PopUp is blank until a selection is made, in spite of the msg stmt showing the assignment is correct. And everything else works –– except for the color issue.
I’m obviously overlooking something here that should be simple. Thanks for any education on these two issues.
