Results 1 to 5 of 5
  1. #1
    Firefighter22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2011
    Posts
    9

    Unbound Combo Box to filter form

    I know this question has been asked before, but I can't seem to find one that fits my situation. I have a form, let's say "frm1". frm1 has 3 subforms, frm2, frm3, frm4. I want to have an unbound combo box that filters all three subforms to show a selected InventoryID. There may be more than 1 instance of InventoryID in all three forms.


    thanks in advance

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Does frm1 have a RecordSource with the InventoryID field? If so, use Master/Child link properties to synchronize the subforms with the parent form. Filter the main form to the desired InventoryID and the subforms will follow. Are the subforms in Datasheet view?
    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
    Firefighter22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Actually, frm1 is basically just a holding place for the 3 subforms and doesn't currently have a record source. One subform is for Purchases, one for Sales, and the last for Available Inventory.
    Yes, all 3 subforms are in Datasheet view, the main form is a Single Form.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The simplest solution might be to implement the scenario I described. Set main form RecordSource to the table having InventoryID as primary key. Set Master/Child links in each of the subform container controls. Then use macro or VBA code to set the main form filter based on the selection in combobox. Code in the AfterUpdate event of the combobox. VBA simply:
    Me.FilterOn = False
    Me.Filter = "InventoryID=" & Me.comboboxname
    Me.FilterOn = True

    Or set the form's Filter property to: InventoryID=Forms!frm1!comboboxname
    then remove the Me.Filter line from the VBA code.

    There is probably a macro version of this but I only use VBA.
    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
    Firefighter22 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2011
    Posts
    9
    Thanks for your help, works great

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

Similar Threads

  1. Filter A Form With Combo Box
    By JeffG3209 in forum Forms
    Replies: 15
    Last Post: 05-27-2011, 09:04 PM
  2. using unbound combo box to filter report
    By jlclark4 in forum Reports
    Replies: 1
    Last Post: 01-25-2011, 04:12 PM
  3. Apply Filter based on unbound date boxes
    By anoob in forum Access
    Replies: 3
    Last Post: 01-21-2011, 05:26 PM
  4. Filter my form from combo box
    By Angate in forum Forms
    Replies: 3
    Last Post: 04-24-2010, 01:57 PM
  5. Replies: 1
    Last Post: 03-26-2010, 10:32 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