Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246

    Unanswered: Resetting Combo boxes

    Hi,
    I have a form that has 3 combo boxes on it, against each combo box is a command button that when the user clicks on it, finds data that matches the combo box selection. When the form first loads all 3 combo boxes are blank (there is no default selection).
    What I want to do is as soon as the user clicks on the drop down arrow on one of the combo boxes, the other 2 combo boxes reset to no value.

    Can anyone point me on the right direction.

    Regards
    John

  2. #2
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    me.your_combo_name.RowSource = ""

    Try that

    Ken

    Ps and me.your_combo_name.value = ""[/i] to clear the one (if selected)

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Ken, thanks for the reply, but sorry to be a thicky where would I put these commands, I take it is in the On Mouse Down event?

    So for Combo A in the event I would put what?
    Combo B ?
    Combo c?

    Sorry for being a pain

    Regards
    John

  4. #4
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    I geus you could use before update on the combo boxes to empty those boxes
    With the
    Your_Combobox.rowsource=""

    When do the combo boxes get filled?
    Because you said they where blank?
    Last edited by DeathWing; 03-18-04 at 07:28.

  5. #5
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi,
    The combo boxes only get filled when the user wants to search for data, once they select an option from the combo box they can then htt the command button to take them to the data. When thay leave the data, they are taken back to the form with the 3 combo boxes. If they wish to do further searchs they can again clikc on the same or another combo box. What I want to happen if they change their mind as to what search they are doing and they select a different combo box, the first selection reverts to null

    Regards
    John

  6. #6
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    So you dont want the whole combo box to lose its rowsource. You only want the data selected at that point to be removed?.

    If so then use
    YourCombobox.value=""

  7. #7
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    Are you just trying to remove the value selected and not Everything in the drop-down..If so read on ! If not..let me know..

    If you have 3 combo boxes A,B and C. And A is the primary, followed by B and C (so if A changes, it blanks B and C, and if B changes C is blanked) you could use.

    On your form in Design mode, get the properties of Combo A and select afterupdate and type me.Combo_B.value = "" and me.Combo_C.value =""

    Under Combo_B afterupdate type me.combo_C.value =""

    Bah, nevermind, I attached a database, its easier to see...



    Ken
    Attached Files Attached Files

  8. #8
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi Ken,
    Thanks for this but not quite what I want to achieve.
    With your example if I select combo A and then combo B, combo A still has a value. and the same with C, its only when I reselect A that B&C reset. What I want to do is when any combo is selected, the other 2 revert to no slection, ie

    Combo A selected, no selection in B or C
    Combo C selected, A resets and nothing in B
    Combo B selected, C resets no selection in A
    Combo A selected, B resets, no selection in C etc etc etc

    So whatever is selected in one combo, the other 2 reset. There is no hierarchy between the 3 combo's

    Thanks for you help

    John

  9. #9
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Sticker
    Hi Ken,
    Thanks for this but not quite what I want to achieve.
    With your example if I select combo A and then combo B, combo A still has a value. and the same with C, its only when I reselect A that B&C reset. What I want to do is when any combo is selected, the other 2 revert to no slection, ie

    Combo A selected, no selection in B or C
    Combo C selected, A resets and nothing in B
    Combo B selected, C resets no selection in A
    Combo A selected, B resets, no selection in C etc etc etc

    So whatever is selected in one combo, the other 2 reset. There is no hierarchy between the 3 combo's

    Thanks for you help

    John
    John,

    Simple. In each of the AfterUpdate events of each combobox put resets for the other 2 comboboxes ...

  10. #10
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    Try this !
    Attached Files Attached Files

  11. #11
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Ken/Mike,
    Thanks very much that works perfectly. Its easy when you know how

    Cheers
    John

Posting Permissions

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