Results 1 to 4 of 4

Problem Creating Combo Box Filters on Form

  1. #1
    Dovon is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    2

    Exclamation Problem Creating Combo Box Filters on Form

    I am trying to make 3 different combo boxes function as filters for my form. The data from each of them comes from a different table and those tables are used as the row sources. All the other data on the form is from a fourth table but the fields that the combo boxes use from their tables are in this table as well. The record source for the table is all the fields from the table and the fields that the combo boxes are using with their criteria set as the combo box selection. In addition I have the event for each of the combo boxes set to after update and have Me.Requery as the code. If I have a single combo box in use it works to filter but if I try to have more than one as a field in the record source with Me.Requery set for them as well I get an enter parameter value pop up. Does anyone know how I can use Multiple Combo Boxes to filter my form? I want it to function as an "AND" not an "OR" btw.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,319
    someone may have a better solution but I'd have a formula like

    iif(isnull([forms]![formname]![fieldname]), 1, iif([forms]![formname]![fieldname] = [FIELDNAME], 1, 0))

    this should return a 1 if no search criteria is entered and reutrn a 1 if the field name on the form matches the field name in the table, otherwise return a zero
    If you do this for your three variables and put a criteria of 1 in each of the columns it should only return the items you're interested in.

    You could also add all the expressions up and put a criteria of 3 in a single field but I would get it working with 1 item first so you understand how it works.

  3. #3
    Dovon is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    2
    Like put that in the criteria or in the code builder?

  4. #4
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,415
    Suggest you examine my two example databases at http://www.mendipdatasystems.co.uk/m...ter/4594454290.
    Both of these show how you can use multiple combo boxes to filter data (as well as other features)
    In each case, a filter string is built up combining the output of each combo selected
    Hopefully you will be able to adapt the approach used for your purposes.
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

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

Similar Threads

  1. Replies: 4
    Last Post: 06-06-2017, 04:26 AM
  2. Search Form combo box filters
    By pbDudley in forum Forms
    Replies: 15
    Last Post: 03-15-2017, 01:23 PM
  3. Replies: 0
    Last Post: 10-03-2013, 09:53 PM
  4. Creating filters in forms using Parameters
    By whitneynf08 in forum Access
    Replies: 4
    Last Post: 01-31-2013, 02:33 PM
  5. Creating Filters on a Form
    By Nixx1401 in forum Access
    Replies: 4
    Last Post: 02-27-2010, 05:32 AM

Tags for this Thread

Posting Permissions

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