Results 1 to 9 of 9

Thread: Block User From Editing The Combo Box Text Value

  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    14

    Block User From Editing The Combo Box Text Value

    Hi

    I have a Userform to insert a Combobox.
    To avoid that you could change the text of the ComboBox I added:

    Code:
    Private Sub ComboBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
        KeyAscii = 0
    End Sub
    Wonder if you can disable the ability for scrolling through all the items to activate a button outside the ComboBox.

    any idea on how to solve this issue?

    thanks in advance

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://eileenslounge.com/viewtopic.php?p=317218#p317218
    https://eileenslounge.com/viewtopic.php?p=316955#p316955
    https://eileenslounge.com/viewtopic.php?p=316955#p316955
    https://eileenslounge.com/viewtopic.php?p=316940#p316940
    https://eileenslounge.com/viewtopic.php?p=316927#p316927
    https://eileenslounge.com/viewtopic.php?p=317014#p317014
    https://eileenslounge.com/viewtopic.php?p=317006#p317006
    https://eileenslounge.com/viewtopic.php?p=316935#p316935
    https://eileenslounge.com/viewtopic.php?p=316875#p316875
    https://eileenslounge.com/viewtopic.php?p=316254#p316254
    https://eileenslounge.com/viewtopic.php?p=316280#p316280
    https://eileenslounge.com/viewtopic.php?p=315915#p315915
    https://eileenslounge.com/viewtopic.php?p=315512#p315512
    https://eileenslounge.com/viewtopic.php?p=315744#p315744
    https://www.eileenslounge.com/viewtopic.php?p=315512#p315512
    https://eileenslounge.com/viewtopic.php?p=315680#p315680
    https://eileenslounge.com/viewtopic.php?p=315743#p315743
    https://www.eileenslounge.com/viewtopic.php?p=315326#p315326
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40752
    https://eileenslounge.com/viewtopic.php?p=314950#p314950
    https://www.eileenslounge.com/viewtopic.php?p=314940#p314940
    https://www.eileenslounge.com/viewtopic.php?p=314926#p314926
    https://www.eileenslounge.com/viewtopic.php?p=314920#p314920
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=314837#p314837
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Attached Files Attached Files
    Last edited by DocAElstein; 05-20-2024 at 04:17 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    The way you've set up your combo box, you cannot make any change to the text. So what is your question?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    If you don't want to use code, you could change the style of the combo box from 0 - fmStyleDropDownCombo to 2 - fmStyleDropDownList
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  4. #4
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    14
    Hi,

    If I open the form, and I scroll items in the list with the Up Dn when I get to the last item selected from the combobox does not have to go out and pick me the next button.
    A problem common to all the combobox I've tried.
    Attached Images Attached Images

  5. #5
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    does not have to go out and pick me the next button
    Cannot understand this part!
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  6. #6
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    14
    Hi,

    One step at a time.
    I have attached some pictures to show the sequence that I note.

    1) I open the Form
    2) I flow with the keyboard entries
    3) When the Combobox showed the last line is disabled by selecting the button below.

    Wonder if you can get to the last line before exiting the ComboBox.

  7. #7
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    It took me 3 hours to understand this (I think I did). So what you're saying is that as you focus on the combo box and press the down arrow to scroll down the list of combo box items, after you reach the last entry (December in this case), and you press the down button again, the focus jumps to the next control in the tab index (the Conferma button in this case), correct?

    I guess that's how all combo boxes work, and I do not understand what's the disadvantage in that. On the contrary, I find that as an advantage, instead of having to work on the tab button, or use the cursor.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  8. #8
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    14
    Hi,

    I guess that's how all combo boxes work, and I do not understand what's the disadvantage in that. On the contrary, I find that as an advantage, instead of having to work on the tab button, or use the cursor.
    I absolutely have to avoid that one can select the following check.
    Alternatively, if you do not find a solution I'll use a ListBox, this review is limited to swipe its entirety.

    Imagine a form with multiple combobox selection problem which create

  9. #9
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    14
    Hi,

    I had tried unsuccessfully with other controls

    To Restrict the selection in the combobox, I added the following code:

    Code:
    Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
      If KeyCode = 40 Then
        With Me.ComboBox1
          If .ListIndex + 1 = .ListCount Then KeyCode = 0
        End With
      End If
    End Sub
    Here is the latest correct version
    Attached Files Attached Files

Similar Threads

  1. User Input requested Search box (floating of static)
    By william516 in forum Excel Help
    Replies: 0
    Last Post: 07-22-2013, 07:53 PM
  2. Solve Block If Without End If Problem
    By jffryjsphbyn in forum Excel Help
    Replies: 3
    Last Post: 06-12-2013, 11:06 AM
  3. Linking a table to a text box
    By Safal Shrestha in forum Excel Help
    Replies: 6
    Last Post: 04-25-2013, 10:37 AM
  4. Find keyword using multiple Text box and combox value
    By Ryan_Bernal in forum Excel Help
    Replies: 2
    Last Post: 03-07-2013, 06:11 PM
  5. Make Text to Numbers Code More User Friendly
    By mrmmickle1 in forum Excel Help
    Replies: 10
    Last Post: 11-20-2012, 06:19 PM

Posting Permissions

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