Results 1 to 2 of 2
  1. #1
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181

    Filter datasheet with combobox

    How do i filter a datasheet when selecting options from a combobox?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    you need to provide details of your form and the datatype of the field you are filtering but assuming you have a main form with a datasheet subform and the combo on the main form is unbound

    in vba you assign a 'where' clause to the subform datasheet filter without the 'where' e.g. for a text field

    mysubformname.form.filter="[somefield]='" & me.comboname & "'"
    mysubformname.form.filteron=true

    or for a numeric datatype

    mysubformname.form.filter="[somefield]=" & me.comboname
    mysubformname.form.filteron=true

    you might put the code in the combo afterupdate event or perhaps the click event of a 'search now' button

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

Similar Threads

  1. Filter datasheet with combobox
    By hinchi1 in forum Access
    Replies: 1
    Last Post: 03-29-2020, 09:48 AM
  2. Replies: 7
    Last Post: 08-17-2016, 11:51 AM
  3. Replies: 1
    Last Post: 09-06-2011, 01:47 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