Results 1 to 7 of 7
  1. #1
    dgwynn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6

    Question Combobox Filtering in Form

    I have an inventory DB that I'd like have filter information through a bound combobox within a form. For instance, I'd like to open the form, use the drop-down box under "Location," select "Attic" and have just those items in the attic available. Preferably, I'd also like to cross-reference with other comboboxes so that I can narrow down available items to those in the "Attic" and those that fall under the criteria of "Electronics" (another bound combobox list). If I can't have the latter, I'd settle for the former. Is this possible? Do I have to learn more VBC?


    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,931
    Don't use bound combobox for selection of filter criteria, you will change the value in record.

    Review
    http://datapigtechnologies.com/flash...combobox2.html
    http://datapigtechnologies.com/flash...tomfilter.html
    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
    dgwynn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6
    Quote Originally Posted by June7 View Post
    Don't use bound combobox for selection of filter criteria, you will change the value in record.

    Review
    http://datapigtechnologies.com/flash...combobox2.html
    http://datapigtechnologies.com/flash...tomfilter.html
    Thank you, June7. The second video looks like exactly what I need!

  4. #4
    dgwynn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6

    Combobox in Form, cont.

    Quote Originally Posted by June7 View Post
    Don't use bound combobox for selection of filter criteria, you will change the value in record.

    Review
    http://datapigtechnologies.com/flash...combobox2.html
    http://datapigtechnologies.com/flash...tomfilter.html
    Followup with solution.

    After watching the video again I found that it was almost but not quite what I was looking for. I have multiple records that fall under the criteria I want to filter and would like all records displayed for its respective criteria. For instance, I have 332 records total but may have only 12 in the location "attic." I'd like to filter so that the number of records available will only be the 12 in the "attic" (if that is the current selected value in the combobox) and not the others. I'm currently searching through the other videos from the same producer for an answer but no luck yet. Any suggestions?

    Thanks

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Don't understand, that video demonstrates techinque that should be adaptable to your requirements. However, here are two more from the same source. They use the same basic technique to filter records.
    http://datapigtechnologies.com/flash...earchform.html
    http://datapigtechnologies.com/flash...mtoreport.html

    Alterntive methods use VBA code to:

    1. build expression to set the filter property of form

    2. build expression for the WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport)

    3. build SQL statement to change RecordSource property
    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.

  6. #6
    dgwynn is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6
    Thanks, again. The video seemed to demonstrate filtering using criteria in which there was only one record. I couldn't get it to work right for my DB (not ruling out user error). I will look over these and consider delving more int VB. Thanks, again, for the help.

    Quote Originally Posted by June7 View Post
    Don't understand, that video demonstrates techinque that should be adaptable to your requirements. However, here are two more from the same source. They use the same basic technique to filter records.
    http://datapigtechnologies.com/flash...earchform.html
    http://datapigtechnologies.com/flash...mtoreport.html

    Alterntive methods use VBA code to:

    1. build expression to set the filter property of form

    2. build expression for the WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport)

    3. build SQL statement to change RecordSource property

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If by 'using criteria in which there was only one record' you mean the result of the filtering was only one record, then yes, could be the result but not always. Depends what value(s) used as criteria. If the criteria is a unique id then the result would be one record and that is demonstrated in the first tutorial. The other two are variations that could result in multiple records returned.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-08-2012, 06:25 PM
  2. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  3. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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