+ Reply to Thread
Results 1 to 4 of 4

Application.SendKeys "%{down}"

  1. #1
    damorrison
    Guest

    Application.SendKeys "%{down}"

    I am trying to get a combobox in a userform to open when it is selected
    but cann't get it to work, here's what I was thinking...


    TextBox1.TabIndex = 1
    TextBox2.TabIndex = 2
    TextBox3.TabIndex = 3
    TextBox4.TabIndex = 4
    ComboBox1.TabIndex = 5
    With ComboBox1
    Application.SendKeys "%{down}"
    End With
    How can I get this to Work


  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello damorrison,

    You need to place the drop down command in the ComboBox's Enter Event. Double click the ComboBox on the UserForm. This will bring up the code window for the default event. In this case it is the Change Event. At the Top Right of the code window, you should see the word Change. Click the down arrow to see the other events. Scroll down to Enter in the list and click it. The editor should insert the following in the code window...

    Private Sub ComboBox1_Enter()

    End Sub


    Insert the following in between the above lines to trigger the Drop Down when the ComboBox is Selected...

    Application.SendKeys "^{F4}"

    Your code should look like this...

    Private Sub ComboBox1_Enter()

    Application.SendKeys "^{F4}"

    End Sub

    Sincerely,
    Leith Ross

  3. #3

    Re: Application.SendKeys "%{down}"

    Do this:

    ComboBox1.SetFocus
    Application.SendKeys "%{down}"


  4. #4
    damorrison
    Guest

    Re: Application.SendKeys "%{down}"

    Thanks alot, works great


+ 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