Kiwi-Wombat
Registered User.
- Local time
- Yesterday, 20:42
- Joined
- Aug 2, 2004
- Messages
- 56
Forgive me if this question has already been asked and solved. Just point me to the thread.
Basically what I want to do is add a specific piece of text to a text field / memo field (at the point where the cursor is) on the click of a button. I then want the cursor to be active at that point so I can continue typing without having to click back into the text field. The text could be hard coded or even double-click action from a separate lookup field
I tried Me.NameOfField = Me.NameOfField & "text to be added".
(I think that is the code. I am away from my home computer at the momemt so can't look it up)
This works perfectly except that it adds the text to the end of the existing text. If your cursor is on the next line or has gone down a couple of lines to start a new paragraph, the inserted text removes these because essentially the are NULL in terms of text. Also the focus has been lost so you have to click on the text / memo field again before you can type
I know this works because I have seen it, but it was a commercial programme and I could view the code.
Note these are shortcuts for commonly added pieces of text and I need several of these buttons to add different things.
I have also tried autokeys which works but the user has to remember which CNTL combination does what.
I presume Send Keys does it somehow but I can't get that to work
Any help would be appreciated
Basically what I want to do is add a specific piece of text to a text field / memo field (at the point where the cursor is) on the click of a button. I then want the cursor to be active at that point so I can continue typing without having to click back into the text field. The text could be hard coded or even double-click action from a separate lookup field
I tried Me.NameOfField = Me.NameOfField & "text to be added".
(I think that is the code. I am away from my home computer at the momemt so can't look it up)
This works perfectly except that it adds the text to the end of the existing text. If your cursor is on the next line or has gone down a couple of lines to start a new paragraph, the inserted text removes these because essentially the are NULL in terms of text. Also the focus has been lost so you have to click on the text / memo field again before you can type
I know this works because I have seen it, but it was a commercial programme and I could view the code.
Note these are shortcuts for commonly added pieces of text and I need several of these buttons to add different things.
I have also tried autokeys which works but the user has to remember which CNTL combination does what.
I presume Send Keys does it somehow but I can't get that to work
Any help would be appreciated