Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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

    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page