Use properties EditBox.SelStart, and perhaps EditBox.SelLength.
Something like:
lcTextToAdd = ThisForm.MyTextBox.Value
with ThisForm.MyEditBox
.Value = .Left(.Value, .SelStart) + lcTextToAdd + substr(.Value, .SelStart+1)
endwith
HTH, Hilmar.
>Thanks for prompt reply
>
>But my problem is slight different.
>
>If user is editing the memo field (Edit Box) and if the cursor is in middle of some sentance and if he wants to insert some variable by clicking on the list box then if I use
>
>ThisForm.MyEditBox.Value = ThisForm.MyEditBox.Value + ...
>
>then that value is getting appended at the end of the myeditbox value and is NOT getting inserted in between.
>
>I hope I have made my point clear.
>
>Is there any solution for this.
>
>Pl. Help.
>
>Thanks once again
>
>Ashish Patel
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)