Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a combo box on a datasheet form

    Sometimes when I open the combo box on a new record/empty combo the light bar is in the middle of the pick list.

    Is there a way to set a combo property so when it is opened on a null combo the light bar is on the first entry every time?

    This particular combo record source is loaded via SQL, Auto Expand = No and there is no Default Value

    Thanks, John

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

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Set the default value to [cboMyCombo].ItemData(0) unless you have column headers showing. In that case, use ItemData(1). Naturally, you need to use the correct name of your combobox.
    Charlotte

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

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    But won't that also set a value for the combo box? I had the impression that John wanted the combo box to remain blank (null).

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

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You're right, Hans, but an itemdata of -1 might do what he wants or at least come close, since it means nothing selected. I know of no way to change the index of the combobox without selecting a value.
    Charlotte

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

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    > I know of no way to change the index of the combobox without selecting a value.

    Me neither, that's why I didn't reply originally.

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Hi Charlotte

    In my situation the following seems to work for me:

    Call Refresh_RC ' set combo record source, requeries specific codes based on category
    Me.RC.DefaultValue = 0
    Me.RC.SetFocus
    Me.RC.Dropdown

    When combo opens nothing is selected, arrow down key selects the first item in list which is what I want.

    I also have heading set to yes

    Thanks, John

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

    Re: Combo Box Behavior? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    That's because row zero is the column headings, which isn't a valid selection. If it works, that's all that matters. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

Posting Permissions

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