Problem editing memo data in a text field in a Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NewBob

    Problem editing memo data in a text field in a Form

    Since Access automatically highlights all of the text in a text
    control (I use it to hold data from a memo field) when the control is
    activated, I've added the following code to put the cursor at the end.

    Private Sub txtCapability_G otFocus()

    ‘ Placed either behind the OnEnter or GotFocus Event of a control
    named,
    ' in this case, txtCapability, on a form ensures that when the control
    is
    ' activated, the cursor will automatically be placed at the END of all
    ' the text present in the textbox
    ' The "cursor at the end" code was taken from "Ten Tips for Microsoft
    Access Developers"
    ' by Frank Rice. The code itself was created by Arvin Meyer, Microsoft
    Access MVP
    ' and taken from a posting to the Access newsgroup
    (microsoft.publ ic.access.forms coding)

    Me!txtCapabilit y.SelStart = Me!txtCapabilit y.SelLength

    End Sub

    The problem is that when I want to edit the text I can only do it at
    the end (where the cursor is). In order to begin editing in the body
    of the text I have to first enter a space (at the end of the original
    text), then I can move the cursor to the place I want to edit. If I
    move the cursor first and start typing, the new text automatically
    appears at the end of the original text.

    Is there some code that I can add that will automatically put in a
    space so that I can immediately move the cursor to the place within
    the text that I want to begin editing? Or, better yet, is there a way
    to activate a text field with data from a memo field and directly
    start editing wherever I place the cursor?

    This text control also has a macro assigned to "On Dirty" that
    automatically updates the ChangeDate field to the current date (so
    that the ChangeDate will always reflect the last time the Capability
    field was changed). Could this have anything to do with it?
  • jmr

    #2
    Re: Problem editing memo data in a text field in a Form

    I just tried this on one of my search screens that starts out
    with a prefix as default. If I move the cursor to the start
    or hit the home key, then type the number 2, it will appear
    at the beginning of the prefix. I am using Access97. I have
    had trouble with this function not working on a Terminal
    server... What version of access are you using? Have you
    checked for patches? Have you tried this before any patches
    are installed?


    On 23 Oct 2003 17:01:22 -0700, NewBob <bjames@calspac e.com> wrote:
    [color=blue]
    > Since Access automatically highlights all of the text in a text
    > control (I use it to hold data from a memo field) when the control is
    > activated, I've added the following code to put the cursor at the end.
    >
    > Private Sub txtCapability_G otFocus()
    >
    > ‘ Placed either behind the OnEnter or GotFocus Event of a control
    > named,
    > ' in this case, txtCapability, on a form ensures that when the control
    > is
    > ' activated, the cursor will automatically be placed at the END of all
    > ' the text present in the textbox
    > ' The "cursor at the end" code was taken from "Ten Tips for Microsoft
    > Access Developers"
    > ' by Frank Rice. The code itself was created by Arvin Meyer, Microsoft
    > Access MVP
    > ' and taken from a posting to the Access newsgroup
    > (microsoft.publ ic.access.forms coding)
    >
    > Me!txtCapabilit y.SelStart = Me!txtCapabilit y.SelLength
    >
    > End Sub
    >
    > The problem is that when I want to edit the text I can only do it at
    > the end (where the cursor is). In order to begin editing in the body
    > of the text I have to first enter a space (at the end of the original
    > text), then I can move the cursor to the place I want to edit. If I
    > move the cursor first and start typing, the new text automatically
    > appears at the end of the original text.
    >
    > Is there some code that I can add that will automatically put in a
    > space so that I can immediately move the cursor to the place within
    > the text that I want to begin editing? Or, better yet, is there a way
    > to activate a text field with data from a memo field and directly
    > start editing wherever I place the cursor?
    >
    > This text control also has a macro assigned to "On Dirty" that
    > automatically updates the ChangeDate field to the current date (so
    > that the ChangeDate will always reflect the last time the Capability
    > field was changed). Could this have anything to do with it?[/color]



    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

    Comment

    • NewBob

      #3
      Re: Problem editing memo data in a text field in a Form

      I am using Access 2002 with Service Pack 2. I started out with this
      (i.e., no previous versions).

      Comment

      Working...