Professional Web Applications Themes

Cursor enter left, center on text exit--How To?? - Microsoft Access

"Berny" <BlancoB at msn Dot com> wrote in message news:%23Sxk3bKRDHA.3192TK2MSFTNGP10.phx.gbl > I have a similar problem > > When I tab into a field in a form it selects all of the text, if you > begin to type you replace all the existing text. > > I know I can change the database options to start at the beginning of > the field, but this changes all fields and databases to this default. > > I only need the cursor to start at the beginning of only a couple of > fields. > > Can this be done? > ...

  1. #1

    Default Re: Cursor enter left, center on text exit--How To??

    "Berny" <BlancoB at msn Dot com> wrote in message
    news:%23Sxk3bKRDHA.3192TK2MSFTNGP10.phx.gbl
    > I have a similar problem
    >
    > When I tab into a field in a form it selects all of the text, if you
    > begin to type you replace all the existing text.
    >
    > I know I can change the database options to start at the beginning of
    > the field, but this changes all fields and databases to this default.
    >
    > I only need the cursor to start at the beginning of only a couple of
    > fields.
    >
    > Can this be done?
    >
    > If so, any direction would be greatly appreciated.
    Paste this function into a standard module (not the form's module):

    '----- start of code -----
    Public Function UnselectText()
    On Error Resume Next
    Screen.ActiveControl.SelLength = 0
    End Function

    '----- end of code -----

    Then, for each of the text boxes you want to behave as you describe, set
    the control's OnEnter property setting (directly on the Event tab of the
    property sheet) to this:

    =UnselectText()

    That ought to do it.

    --
    Dirk Goldgar, MS Access MVP
    [url]www.datagnostics.com[/url]

    (please reply to the newsgroup)


    Dirk Goldgar Guest

  2. #2

    Default Re: Cursor enter left, center on text exit--How To??

    Thank you,

    It worked perfectly

    "Dirk Goldgar" <dgNOdataSPAMgnostics.com> wrote in message
    news:uhE8mjKRDHA.2460TK2MSFTNGP10.phx.gbl...
    > "Berny" <BlancoB at msn Dot com> wrote in message
    > news:%23Sxk3bKRDHA.3192TK2MSFTNGP10.phx.gbl
    > > I have a similar problem
    > >
    > > When I tab into a field in a form it selects all of the text, if you
    > > begin to type you replace all the existing text.
    > >
    > > I know I can change the database options to start at the beginning of
    > > the field, but this changes all fields and databases to this default.
    > >
    > > I only need the cursor to start at the beginning of only a couple of
    > > fields.
    > >
    > > Can this be done?
    > >
    > > If so, any direction would be greatly appreciated.
    >
    > Paste this function into a standard module (not the form's module):
    >
    > '----- start of code -----
    > Public Function UnselectText()
    > On Error Resume Next
    > Screen.ActiveControl.SelLength = 0
    > End Function
    >
    > '----- end of code -----
    >
    > Then, for each of the text boxes you want to behave as you describe, set
    > the control's OnEnter property setting (directly on the Event tab of the
    > property sheet) to this:
    >
    > =UnselectText()
    >
    > That ought to do it.
    >
    > --
    > Dirk Goldgar, MS Access MVP
    > [url]www.datagnostics.com[/url]
    >
    > (please reply to the newsgroup)
    >
    >

    Berny Guest

Similar Threads

  1. Replies: 0
    Last Post: March 5th, 03:54 PM
  2. #35872 [Asn]: CLI errors upon exit if class is left on IE
    By wharmby@php.net in forum PHP Bugs
    Replies: 0
    Last Post: March 5th, 02:16 PM
  3. #35872 [Com]: CLI errors upon exit if class is left on IE
    By wharmby at uk dot ibm dot com in forum PHP Bugs
    Replies: 1
    Last Post: January 31st, 01:19 PM
  4. How to center text in dynamic HTML text field ???
    By AmnISaid webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 20th, 03:01 PM
  5. How to exit a Cursor
    By exBK in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 1st, 03:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139