Results 1 to 5 of 5

Thread: Key combo to "press" command button

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    3

    Key combo to "press" command button

    I've got a main menu with five command buttons named:
    "Registratie" "Camping" "Locaties" "Bezoekers" and "Afsluiten"

    It would be nice if i could choose (press) one of those command buttons by making a key combo Alt+character This must be working exactly the same as opening a menu. For example file alt+f = file.

    Registratie i want to choose with Alt+R, Camping with Alt+C, Locaties with Alt+L, Bezoekers with Alt+B and Afsluiten with Alt+A.



    Now i think i have to do something in here...
    ----------------
    Private Sub cmdRegistratie_KeyPress(KeyAscii As Integer)

    ???

    End Sub
    ----------------

    Who can help me?

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    This is set using the Accelerator property.
    Regards
    BrianB
    -------------------------------

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    also by putting the & in front of the letter you want to use in the caption.
    &Registrate, &Camping, &Locaties , etc.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    3
    Both of these solutions don't work, cause it's VBA, sorry for not saying before.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    3
    techgnome's solution DID work, but i put in the code, the & should be putted infront of the button name in it's properties

    thx guys

Posting Permissions

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



Click Here to Expand Forum to Full Width