I have a field in the farpoint grid that is called Quantity. I fill
it from the database when the form first opens. The user can type a
number into this field if they want, or they can use a digitizer to
calculate a value that is then "returned" to my program, in the active
control. This works. However, I have a problem in that the value
returned from the digitizer needs to ADD to whatever was already in
the field. The digitizer clears out what was already in the field, so
I must hold onto the "original" quantity, then add what the digitizer
sends me.
Therein lies the problem. I don't know all the time what the
"original" quantity should be. Initially when I load the form, it's
easy -- it's the same as the current quantity. However, if they type
in 0 or 555 into the quantity field, I SHOULD update the original
quantity variable. But, when the digitizer sends me the new quantity
(to add to the original) it first clears out the field, sending
numlock, 0, numlock, numlock, value (sent as individual characters
just like the others of course), F9, numlock. Where I'm hitting
problems is the 0 in the 2nd character that the digitizer sends to me.
I can't distinguish between a USER specified "I want to put 0 in this
quantity" vs. the digitizer "I'm sending 0, well, I'm not sure why but
I'm going to anyway". If I update the original quantity variable to
mirror the quantity field on the keyup event, I will replace what is
already there with a 0 when the digitizer sends. So, if I ignore a 0
entry, then the user can't 0 it out for himself.
Can anyone see a solution to this dilemma? Did I explain it well
enough?
Thanks for any and all responses.
Matt