The user types, for example, $ 325.00 in a texfield, and I would need that, using my function implemented in Writer, another textfield would display the value in full.
oForm = oEv.Source.Model.Parent
Num$ = oForm.getByName("Value Box").Text
oForm.getByName("txtOutput").Text = USCurrencyToWords(Num$)
|Edit: Later in this thread is a revised and potentially more general version in that it eliminates reliance on one of the named form controls|
The macro to apply the function can be triggered by, and only by, pressing a specified key: for example, the RETURN key after entering numeric data.In addition the user would always have to trigger the macro in order for the document to be updated, which is something that makes data reliability questionable.
Again without knowing the circumstances under which 'new fields appear' the field(s) used for entering numeric data can readily be copied with each making use of the same macro code: the two sample duplicate entry fields can be further added to.The point is that using macro involves updating the code whenever new fields appear; Which makes maintenance difficult.
Users browsing this forum: No registered users and 6 guests