• Combobox dropdown (All versions)

    Author
    Topic
    #395989

    I like to use the DropDown method in a combobox’s OnEnter event. This way, when the user tabs into the control, the list drops down.

    This sometimes causes problems if the user should get there by clicking on the combo’s dropdown arrow. In this case, the list list actually drops down for an instant, but then closes (on a fast computer, you don’t even see the momentary dropdown).

    What is strange is that this phenomenon seems to be form specific; that is, it seems to affect all the combo boxes on a form, or none at all. I can copy a combobox that I’m having this problem with from one form and paste it onto another form, and it works fine; that is, clicking on the down arrow will drop the listbox and it will stay down! But if I then paste this same combobox again on the original form, it doesn’t work. I absolutely can not figure out the circumstances that cause it to fail (or not to fail).

    Any help would be greatly appreciated.

    Viewing 4 reply threads
    Author
    Replies
    • #738866

      I haven’t seen this behavior (dropdown list closing again), but perhaps you can do something with the routines in API: Determining Combobox’s Dropped state on the Access Web.

      (And if you like, you could post a dummy database with a form that demonstrates the problem)

      • #738876

        Hans,

        Thanks, I’ll checkout that API, it might help.

        It’s hard to post a dummy showing problem, because I can’t create a simple form on which it fails; I only have “live” forms which require numerous tables and modules being present, and so can’t be easily extracted.

      • #738877

        Hans,

        Thanks, I’ll checkout that API, it might help.

        It’s hard to post a dummy showing problem, because I can’t create a simple form on which it fails; I only have “live” forms which require numerous tables and modules being present, and so can’t be easily extracted.

    • #738867

      I haven’t seen this behavior (dropdown list closing again), but perhaps you can do something with the routines in API: Determining Combobox’s Dropped state on the Access Web.

      (And if you like, you could post a dummy database with a form that demonstrates the problem)

    • #738874

      Mark
      For what it’s worth I use the dropdown method extensively in my database, but, only if when entering, it is null.

      Private Sub PaintType_Enter()
      ‘dropdown combo if empty
      If IsNull([PaintType]) Then
      [PaintType].Dropdown
      End If
      End Sub

      By this, if a user enters the combo which currently holds no data selected, Dropdown occurs.
      Once the user has selected data, on entering again, the combo stays static.
      But I’ve never seen a combo react in the way you have posted.
      Is there any other code behind the combo which may be interfering.?

      • #738881

        I can’t see that there is anything behind the combobox itself that is causing this. It seems that if I have such a problem with 1 combobox on a form, I have the same problem with all the combos on the form. It doesn’t seem to relate to how complicated the form is, whether it is a form or subform, or even how I actually get to the dropdown method (sometimes I have it in the OnEnter Event procedure, but sometimes I have a function that includes the dropdown method that I use instead).

        Right now, I’m resorting to putting a transparent command button over the dropdown arrow, so when users try to click the arrow, they will actually click the command button (which then sends focus to the combo box).

      • #738882

        I can’t see that there is anything behind the combobox itself that is causing this. It seems that if I have such a problem with 1 combobox on a form, I have the same problem with all the combos on the form. It doesn’t seem to relate to how complicated the form is, whether it is a form or subform, or even how I actually get to the dropdown method (sometimes I have it in the OnEnter Event procedure, but sometimes I have a function that includes the dropdown method that I use instead).

        Right now, I’m resorting to putting a transparent command button over the dropdown arrow, so when users try to click the arrow, they will actually click the command button (which then sends focus to the combo box).

    • #738875

      Mark
      For what it’s worth I use the dropdown method extensively in my database, but, only if when entering, it is null.

      Private Sub PaintType_Enter()
      ‘dropdown combo if empty
      If IsNull([PaintType]) Then
      [PaintType].Dropdown
      End If
      End Sub

      By this, if a user enters the combo which currently holds no data selected, Dropdown occurs.
      Once the user has selected data, on entering again, the combo stays static.
      But I’ve never seen a combo react in the way you have posted.
      Is there any other code behind the combo which may be interfering.?

    • #738878

      I would suspect other code in the form conflicting with the OnEnter event. When you paste the control into another form, do you paste *all* the procedures associated with it? What about something in the Form’s OnCurrent event?

      • #738894

        Charlotte,

        Here’s what I’ve tried. I selected a combobox on a form that is causing me problems, then did a Ctl-C to copy it to clipboard. I then created a new form and did a Ctl-V to copy it onto the new form. The OnEnter property contains a function that includes the dropdown method, so I don’t have to create any event procedures. On the new form, it works. I then go back to the old form and do a Ctl-V to place the control again on the form. It doesn’t work there.

        I suppose there is something on the form that is causing this, but I don’t know where or why. I can’t detect any pattern, such as bound vs. unbound forms, bound vs. unbound controls, etc. For awhile I thought it had to do with the form originally being created in Access97 and then converted to Access2000, but that doesn’t seem to be it either. The only thing I can determine is that it seems to be form specific; that is, it either all the combo boxes work or don’t work on a specific form.

      • #738895

        Charlotte,

        Here’s what I’ve tried. I selected a combobox on a form that is causing me problems, then did a Ctl-C to copy it to clipboard. I then created a new form and did a Ctl-V to copy it onto the new form. The OnEnter property contains a function that includes the dropdown method, so I don’t have to create any event procedures. On the new form, it works. I then go back to the old form and do a Ctl-V to place the control again on the form. It doesn’t work there.

        I suppose there is something on the form that is causing this, but I don’t know where or why. I can’t detect any pattern, such as bound vs. unbound forms, bound vs. unbound controls, etc. For awhile I thought it had to do with the form originally being created in Access97 and then converted to Access2000, but that doesn’t seem to be it either. The only thing I can determine is that it seems to be form specific; that is, it either all the combo boxes work or don’t work on a specific form.

    Viewing 4 reply threads
    Reply To: Combobox dropdown (All versions)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: