Results 1 to 5 of 5
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    on load clear combo box


    All; using access 2010. I have a form with a table with one field for the record source. The field contains the cust num. Then I have a subform with a cust num field and additional data fields. I use a combo box with the cust num field on the main form. I want the user to select the cust num from the combo box and filter the subform to that particular cust num. For some reason; when I added the subform with the wizard; it didn't suggest the master and child links. I had to create them. I select a cust num from the combo box and it doesn't change the subform until I close and reopen the form. I need both forms to clear on load.

    I'm using the code afterupdate:

    Code:
    Me.Filter = "[cust_num]=" & cbocust_num
       Me.FilterOn = True
    What am I doing wrong please.

  2. #2
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Wait you want the form to clear on load or to filter based on your combo box selection? I am getting mixed signals.

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Sorry; I want to filter based on the combo box selection. I also want when the form is opened by the user; the combo box is cleared.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Combobox for user to input filter criteria must be UNBOUND - otherwise will change data in record. This means it will already be 'clear' when the form opens.

    If the main form is bound then set the subform container Master/Child links properties to synchronize records. Apply filter to main form and only related records will display in subform.

    What tables are these forms bound to?
    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
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thanks All. I had a brain fog yesterday. Got it.

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

Similar Threads

  1. Clear Filters and Checks on Load--Form
    By nick404 in forum Forms
    Replies: 11
    Last Post: 06-09-2015, 10:46 AM
  2. Clear selected value in combo box
    By bbrazeau in forum Programming
    Replies: 6
    Last Post: 08-05-2014, 12:38 AM
  3. Clear text box on form load
    By RoyLittle0 in forum Access
    Replies: 3
    Last Post: 03-05-2013, 05:40 AM
  4. Clear combo box
    By Cindygo in forum Forms
    Replies: 3
    Last Post: 09-19-2011, 09:25 AM
  5. Clear value list in combo box
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 05-27-2011, 12:45 PM

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