+ Reply to Thread
Results 1 to 3 of 3

Execute Code

  1. #1
    Forum Contributor
    Join Date
    01-19-2006
    Posts
    142

    Execute Code

    Hi all,

    I want to execute all the code in a cmdButton on a userform when a keypress is registerd.

    Please Login or Register  to view this content.
    Any ideas? Thanks!

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    move the code inside the command button routine into a general module (create the module using insert...module and call it as a public sub

    eg
    public sub doCMD

    end sub


    then change the cmdbutton code to call doCMD and the keypress if ascii=10 to call docmd

    Hope this helps
    regards,

    Quote Originally Posted by gti_jobert
    Hi all,

    I want to execute all the code in a cmdButton on a userform when a keypress is registerd.

    Please Login or Register  to view this content.
    Any ideas? Thanks!

  3. #3
    Ardus Petus
    Guest

    Re: Execute Code

    See amanded code

    HTH
    --
    AP

    "gti_jobert" <[email protected]> a
    écrit dans le message de
    news:[email protected]...
    >
    > Hi all,
    >
    > I want to execute all the code in a cmdButton on a userform when a
    > keypress is registerd.
    >
    >
    > Code:
    > --------------------
    >
    > Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    > If KeyAscii = 10Then

    cmdSearch
    > End If
    > End Sub
    >
    > --------------------
    >
    >
    > Any ideas? Thanks!
    >
    >
    > --
    > gti_jobert
    > ------------------------------------------------------------------------
    > gti_jobert's Profile:

    http://www.excelforum.com/member.php...o&userid=30634
    > View this thread: http://www.excelforum.com/showthread...hreadid=518152
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1