The Return Key

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

    The Return Key

    I need a way to disable the Return/Enter key in specific fields or on
    a given form.

    The goal is to limit way the user exits field as there is necessary
    code run when the user exits the field and the Exit Event doesn't seem
    to recognize exiting via the Return/Enter key but does for the Tab or
    Arrow keys. So I want to limit the user to using the tab or arrow
    keys to manuver between fields.

    I have tried adjusting the Tools/Options/Keyboard from "Next Record"
    to "Next Field" but it doesn't seem to work in a form, just
    datasheets. I have also adjusted the "Enter Key Behavior" property in
    the properties for the relative fields but that only hides the data by
    creating a new line (thus confusing the user as to if they actually
    put data in a one line textbox).

    So I am assuming that I need to either find a way to disable the
    Return/Enter Key or find a way for the Exit event to recognize a
    Return/Enter keystroke.

    Any help would be appreciated.

    von
  • Patrick Fisher

    #2
    Re: The Return Key

    The following will disable the Return key:

    In the Keydown event of the form:

    Select Case KeyCode
    Case 13
    KeyCode = 0
    End Select

    Patrick



    On 15 Oct 2004 10:16:48 -0700, redbai@MailAndN ews.com (Von Bailey)
    wrote:
    [color=blue]
    >I need a way to disable the Return/Enter key in specific fields or on
    >a given form.
    >
    >The goal is to limit way the user exits field as there is necessary
    >code run when the user exits the field and the Exit Event doesn't seem
    >to recognize exiting via the Return/Enter key but does for the Tab or
    >Arrow keys. So I want to limit the user to using the tab or arrow
    >keys to manuver between fields.
    >
    >I have tried adjusting the Tools/Options/Keyboard from "Next Record"
    >to "Next Field" but it doesn't seem to work in a form, just
    >datasheets. I have also adjusted the "Enter Key Behavior" property in
    >the properties for the relative fields but that only hides the data by
    >creating a new line (thus confusing the user as to if they actually
    >put data in a one line textbox).
    >
    >So I am assuming that I need to either find a way to disable the
    >Return/Enter Key or find a way for the Exit event to recognize a
    >Return/Enter keystroke.
    >
    >Any help would be appreciated.
    >
    >von[/color]

    Comment

    • Von Bailey

      #3
      Re: The Return Key

      Patrick Fisher <info@psoftuk.c om> wrote in message news:<dl20n05bo dj3bu6ch3dtrkrf 1q89kglmfe@4ax. com>...

      Thanks...
      von
      [color=blue]
      > The following will disable the Return key:
      >
      > In the Keydown event of the form:
      >
      > Select Case KeyCode
      > Case 13
      > KeyCode = 0
      > End Select
      >
      > Patrick
      >
      >
      >
      > On 15 Oct 2004 10:16:48 -0700, redbai@MailAndN ews.com (Von Bailey)
      > wrote:
      >[color=green]
      > >I need a way to disable the Return/Enter key in specific fields or on
      > >a given form.
      > >
      > >The goal is to limit way the user exits field as there is necessary
      > >code run when the user exits the field and the Exit Event doesn't seem
      > >to recognize exiting via the Return/Enter key but does for the Tab or
      > >Arrow keys. So I want to limit the user to using the tab or arrow
      > >keys to manuver between fields.
      > >
      > >I have tried adjusting the Tools/Options/Keyboard from "Next Record"
      > >to "Next Field" but it doesn't seem to work in a form, just
      > >datasheets. I have also adjusted the "Enter Key Behavior" property in
      > >the properties for the relative fields but that only hides the data by
      > >creating a new line (thus confusing the user as to if they actually
      > >put data in a one line textbox).
      > >
      > >So I am assuming that I need to either find a way to disable the
      > >Return/Enter Key or find a way for the Exit event to recognize a
      > >Return/Enter keystroke.
      > >
      > >Any help would be appreciated.
      > >
      > >von[/color][/color]

      Comment

      Working...