Pretty snazzy, Gonz! You're one heck of a good coder :-)
The only change I have to put in right now, in the lost focus event, place a test for type('eval(this.value)') = "N" That will keep the user from making it bomb by trying to put in their name or something. I suppose that if the test fails, the expression should either be left alone with a warning message, or the box should change to zero (0).
>Already on it's way --- bear in mind that this is proof of concept. Also, I forget to say in the email, you set the controlsource at design time as you would any other bound control. The control itself swaps out the CS and maintains the value and the updating of the controlsource source value.
>
>>John! You're the
best man! Send me a copy, please :-)
>>
>>>Hi Todd ---
>>>
>>>OK, I wrote it. Who wants it?
>>>
>>>
>>>>Mark Mccasland and I came up with an idea for a textbox that will allow users to enter numeric expressions (17+23 will be replaced with 40)
>>>>
>>>>Mark suggested, and I agree that to make it work nicely, we'll have to manually bind the textbox to a field.
>>>>
>>>>I would like to still use the controlsource property to name the field that the textbox is bound to, but I want to handle the updates to and from that field on my own.
Where all do I need to place a "nodefault" setting to keep the controlsource from overridding my textbox?>>>>
>>>>Keep in mind, I have to make sure the textbox is always a character value, and I have to make sure its big enough for the user to enter a reasonable length expression.
>>>>
>>>>Thanks!
--Todd Sherman
-Wake Up! Smell the Coffee!