Results 1 to 3 of 3
  1. #1
    tonygg is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    115

    Resetting Combo Box in VBA

    Hi. I am struggling with resetting my combo box in VBA

    I have two in my form that has a query as the row source. A user chooses a product from the first and a manufacturer from the second. This correctly brings back the required list of values. I can selected from the list and use the resulting selection. All good so far.

    The problem is that the form remembers the users selection. This means that next time if they forget to select a row the form uses the old section. So if they choose a different product but not a different manufacturer it will think they wanted to use the old manufacturer choice (and visa versa). I use the selections to update the DB.

    I want to force the selections to be cleared in the combo boxes and go back to "blank" or "None Selected" once I update the record in the DB. This forces the user to make new selections and removes any confusion the user has about whether he has made a selection or not.

    just cant seem to find anywhere to force the combo box to clear the selection.

    I tried :
    Code:
    Me.SectionMan.SelectedIndex = 0
    Me.SectionMan.SelectedIndex = -1
    This does not work. Particularly as the user might not have selected a row say for instance on form load or selection of a new product but not yet selected a manufacturer.



    I need a solution that works to clear the section if they made one in the combo box.

    I am sure there must be a simple solution. Please could someone put me out of my misery!

    Many thanks

    Tony

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    cboBox = null

  3. #3
    tonygg is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    115
    Thank you. Feel stupid now. I guess i tried to over think it

Please reply to this thread with any new information or opinions.

Similar Threads

  1. resetting combo box
    By xopherira in forum Forms
    Replies: 1
    Last Post: 08-07-2015, 11:59 AM
  2. Auto number resetting
    By malix.creatives in forum Sample Databases
    Replies: 0
    Last Post: 02-17-2015, 07:50 AM
  3. Using DSUM resetting upon next ID in dataset
    By ellisjo3 in forum Queries
    Replies: 18
    Last Post: 01-13-2014, 09:24 AM
  4. Code For Resetting to Default Value
    By batowl in forum Forms
    Replies: 4
    Last Post: 03-14-2012, 02:54 PM
  5. Resetting autonumber when importing
    By bullwinkle55423 in forum Access
    Replies: 3
    Last Post: 06-30-2009, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums