Hi,
you can try something like this:
with screen.activecontrol
.SelStart = Len(.Text)
end with
--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
"Guy" <(E-Mail Removed)> wrote in message
news:81CC039D-E651-4AA2-8E31-(E-Mail Removed)...
> Hi All,
>
> Just want to set up a ctrl key combination to insert the username and a
> date
> stamp at the current insertion point in the textbox such as:
>
> Fred 4-Jul-08:
>
> Leaving the insertion point at the end of the line ready for the user to
> start typing.
>
> Diary notes are generally added to the start of the multiline textbox so
> that the most recent note is at the top as in:
>
> Fred 4-Jul-08: Phoned Julie in Operations and arranged a date and time to
> pick up the dry cleaning.
> Dave 21-Jun-08: Phoned Alice in Accounts to advise them that their account
> was 30 days overdue. Alice said payment will be processed in next cheque
> run
> due Wed.
>
> And so on.
>
> No problem achieving the timestamp using either an AutoKey that runs code
> to
> build and insert the text into the current active control (if it is a
> textbox) or alternatively using the keypress event on the control itself.
>
> The problem I have is setting the insertion point.
>
> I have tried Sendkeys "{End}" and various other combinations but can't get
> it to work. Probably missing something obvious, but can anyway help?
>
> Guy