| re: How to restore cursor position after acSaveRecord?
When you ask Access to save the record, it also finalizes the field edit.
Access trims trailing blanks from data entered by hand into a field, so the
space character is lost. I think you will have to cache the value of the
field's Text property before the acCmdSaveRecord, then use the field's
AfterUpdate handler to re-write it to the control.
Another option would be to update the floater window differently so that you
can use the Text property to update the floating window (floater sounds like a
corpse to me <g>) immediately rather than having to save the entire record.
On Mon, 20 Dec 2004 00:18:46 GMT, "(Pete Cresswell)" <x@y.z> wrote:
[color=blue]
>Right now, as the user types I'm invoking this code in the field's Change event:
>-----------------
> With theField
> cursorPos = .SelStart
> Application.RunCommand acCmdSaveRecord
> .SelStart = cursorPos
> End With
>-----------------
>
>The idea is that there may be a floater window open that's linked to the same
>field and I want the user's typing to show up immediately in both windows.
>
>The code above works...sort of.... but it seems TB swallowing SpaceBars. i.e.
>If somebody types "xyz" it works OK. But if somebody types "x y z", what gets
>to the field is only "xyz".
>
>I tried .SelStart = cursorPos + 1, but it didn't help...seems like the spaces
>just aren't there at that time...yet amphamerics are...
>
>?[/color] |