Results 1 to 7 of 7
  1. #1
    gaby58 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    19

    Resetting the Combo Box

    Hi All,

    I have a Combo box on a form and the form has about 10 text boxes and all the values are coming from Query, when I select the value in a combo box, it will display according that value, however when I don't select anything also then also the values in the text boxes still exist, how do I reset to empty values in the text box.

    Also if the value is entered in one of the text box which has unique value, it should be able to display values on the other text boxes, is it possible?


    Thank You

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    If controls are bound to data then changing a value in textbox changes the data in record. Controls used as input for filter criteria must be UNBOUND. Review http://allenbrowne.com/ser-62.html

    If you want to provide db for analysis, follow instructions at bottom of my post. Identify the form that has issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gaby58 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    19

    Resetting Combobox

    Thank you, actually when the form runs the combo box has no value, but all the text boxes have value, so they also should not have any value and when we toggle back to value it should display all the values(it is doing already), again when we go back to no value in Combo box, it should reset all the text values to null. How to accomplish this one?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Don't bind textboxes to fields. Or if bound to fields, move to New Record row.

    I don't really understand what you are trying to accomplish.

    Did you review the link?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    If I understand your requirement correctly ...
    When you open a form with a combo box as a selector for a data record, the selector itself is blank but the other fields have (apparently spurious) data in them. You would prefer those fields to be blank whenever the selector is blank. ??
    If that understanding is correct, then one solution is to set those other fields' visibility to 'No' whilst the selector is blank. I can't recall the actual syntax but it would be something like:
    If me.selectorbox = "" then me.otherfield.visible = no
    but you will need to research the actual coding to make it work.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Exactly how are you causing the textboxes to be populated with data related to the combobox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    If you have form textboxes bound to a table, your thinking is all wrong. The form presents a record in the table. If you blank out the form, you will blank out the current displayed record. Not delete it, but blank out its fields in the table.
    That probably is not what you want.
    Why do you want to see a blank form?

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

Similar Threads

  1. Resetting Combo Box in VBA
    By tonygg in forum Access
    Replies: 2
    Last Post: 09-06-2017, 06:26 AM
  2. resetting combo box
    By xopherira in forum Forms
    Replies: 1
    Last Post: 08-07-2015, 11:59 AM
  3. Auto number resetting
    By malix.creatives in forum Sample Databases
    Replies: 0
    Last Post: 02-17-2015, 07:50 AM
  4. Using DSUM resetting upon next ID in dataset
    By ellisjo3 in forum Queries
    Replies: 18
    Last Post: 01-13-2014, 09:24 AM
  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