Hi
I have a form with a textbox attached to a memo field and several buttons which insert specific text into the textbox. (Imagine a simple HTML Editor on an Access form). When I click a button, the textbox loses the focus so I write the insertion point to a variable in the textbox_Exit event (have also tried Keypress and Keyup events) using text1.selstart so that when a button is clicked, the app knows where to insert the appropriate text into the textbox.
The trouble is, text1.selstart returns 0 at all times unless the textbox is clicked. For example, if I type text anywhere within the content of the textbox then click a button, the variable is 0, if I click at position n within the textbox, the variable is set to n.
I'm wondering if I am looking in the wrong place. The question is, how do I record the current cursor position in a textbox_Exit event. It sounds simple to me, but I must be simpler!
Thanks for any help.
Steve
I have a form with a textbox attached to a memo field and several buttons which insert specific text into the textbox. (Imagine a simple HTML Editor on an Access form). When I click a button, the textbox loses the focus so I write the insertion point to a variable in the textbox_Exit event (have also tried Keypress and Keyup events) using text1.selstart so that when a button is clicked, the app knows where to insert the appropriate text into the textbox.
The trouble is, text1.selstart returns 0 at all times unless the textbox is clicked. For example, if I type text anywhere within the content of the textbox then click a button, the variable is 0, if I click at position n within the textbox, the variable is set to n.
I'm wondering if I am looking in the wrong place. The question is, how do I record the current cursor position in a textbox_Exit event. It sounds simple to me, but I must be simpler!
Thanks for any help.
Steve