Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Combobox dropdown (All versions)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combobox dropdown (All versions)

    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)

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combobox dropdown (All versions)

    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.?

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Combobox dropdown (All versions)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combobox dropdown (All versions)

    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?
    Charlotte

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Combobox dropdown (All versions)

    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).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Combobox dropdown (All versions)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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