Hi,
The problem here is that when you click on the button, IT has the focus, so you can't refer to the text box's GotFocus event or status, because it no longer has that status.
Can you make a button for each text box? That way each button can just refer to its own text box. You could even make them invisible until the text box has a GotFocus, OnChange, AfterUpdate or OnDirty event, I am not sure which one. That would be the thing to do until someone comes up with the answer to this one.
Another thing you might try is putting a variable on the form somewhere that holds a value from your text boxes such that, when txtBox1 gets the focus, the variable changes to 1, when txtBox2 has the focus, it changes to 2, etc. Then your button could check that value, be referred to the text box that last had the focus, and get the proper data by referral. It may not be a variable, but another hidden text box that has a value placed in it depending on the text box focus, etc.
mmcdonal
|