Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

On user hit [enter] (On KeyPress)

Discussion in 'Information Technology' started by James, Jul 28, 2006.

  1. James

    James
    Expand Collapse
    Guest

    I have a text box with a cmdButton right next to it.

    So the user types their input in the box and hits enter, expecting it
    to return values. Well instead, enter just moves it to the next tab
    order, which is the cmd box. I understand that the on key press will
    trigger this event, but it will also do it if the button as been tabbed
    to. Is there any way to just specify the enter key for doing this?
    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    After FIR, Social Media Users Wary of Offensive Jokes on Sardars Information Technology Oct 2, 2013
    USA US govt secretly collecting data on millions of Verizon users: Report Breaking News Jun 6, 2013
    using spiritual name as a username Questions and Answers Aug 23, 2012
    Audience of 3 Million Users Receiving Anti-Sikh Messages Hard Talk Sep 17, 2010
    General How can I change my username ? Hard Talk Sep 4, 2010

  3. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    James wrote:
    > I have a text box with a cmdButton right next to it.
    >
    > So the user types their input in the box and hits enter, expecting it
    > to return values. Well instead, enter just moves it to the next tab
    > order, which is the cmd box. I understand that the on key press will
    > trigger this event, but it will also do it if the button as been
    > tabbed to. Is there any way to just specify the enter key for doing
    > this? Thanks!


    Look at the property sheet for your button on the {Other} tab of the
    property sheet. You should see a property named "Default". Set that to Yes
    and your button action will run any time the user presses <Enter>.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  4. James

    James
    Expand Collapse
    Guest

    Great! Thanks!

    Rick Brandt wrote:
    > James wrote:
    > > I have a text box with a cmdButton right next to it.
    > >
    > > So the user types their input in the box and hits enter, expecting it
    > > to return values. Well instead, enter just moves it to the next tab
    > > order, which is the cmd box. I understand that the on key press will
    > > trigger this event, but it will also do it if the button as been
    > > tabbed to. Is there any way to just specify the enter key for doing
    > > this? Thanks!

    >
    > Look at the property sheet for your button on the {Other} tab of the
    > property sheet. You should see a property named "Default". Set that to Yes
    > and your button action will run any time the user presses <Enter>.
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
     
  5. James

    James
    Expand Collapse
    Guest

    ooo... problem... there can only be one default enter on the form i
    have 4 instances of a txt box followed by a cmd button.... any clue on
    how to do it for 4 buttons on one form? Thanks

    Rick Brandt wrote:
    > James wrote:
    > > I have a text box with a cmdButton right next to it.
    > >
    > > So the user types their input in the box and hits enter, expecting it
    > > to return values. Well instead, enter just moves it to the next tab
    > > order, which is the cmd box. I understand that the on key press will
    > > trigger this event, but it will also do it if the button as been
    > > tabbed to. Is there any way to just specify the enter key for doing
    > > this? Thanks!

    >
    > Look at the property sheet for your button on the {Other} tab of the
    > property sheet. You should see a property named "Default". Set that to Yes
    > and your button action will run any time the user presses <Enter>.
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
     
  6. ChrisM

    ChrisM
    Expand Collapse
    Guest

    How about handling the OnKeyDown event in each text box. If the KeyCode = 13
    then ENTER has been pressed, and you can act accordingly...

    Cheers,
    Chris.

    "James" <jamesburkett@gmail.com> wrote in message
    news:1153486996.249971.24380@75g2000cwc.googlegroups.com...
    > ooo... problem... there can only be one default enter on the form i
    > have 4 instances of a txt box followed by a cmd button.... any clue on
    > how to do it for 4 buttons on one form? Thanks
    >
    > Rick Brandt wrote:
    >> James wrote:
    >> > I have a text box with a cmdButton right next to it.
    >> >
    >> > So the user types their input in the box and hits enter, expecting it
    >> > to return values. Well instead, enter just moves it to the next tab
    >> > order, which is the cmd box. I understand that the on key press will
    >> > trigger this event, but it will also do it if the button as been
    >> > tabbed to. Is there any way to just specify the enter key for doing
    >> > this? Thanks!

    >>
    >> Look at the property sheet for your button on the {Other} tab of the
    >> property sheet. You should see a property named "Default". Set that to
    >> Yes
    >> and your button action will run any time the user presses <Enter>.
    >>
    >> --
    >> Rick Brandt, Microsoft Access MVP
    >> Email (as appropriate) to...
    >> RBrandt at Hunter dot com

    >
     

Share This Page