Results 1 to 5 of 5
  1. #1
    tagteam is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    501

    Run filter from button on subform

    I am using a split form with the worksheet on the left and on the right is a regular form on the right with the regular form is a subform using the type of form of continuous form. I am trying to create a button that will automatically filter the sub form, which is a continuous form, with prespecified conditions. however it does not seem to work I have tried a couple of different options including DoCmd.pplyFilter As well as formname.filter with where conditions.


    I just want to be able to click a button on the sub form and have it filter for my preset criteria.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    You did not say what that button will do or how you want the subform changed but maybe use the Record Source of the subform with specific criteria to manipulate it and at the end of your code on that button, do a Forms!Mainform!Subform.Requery (change Mainform and Subform to your names)

  3. #3
    tagteam is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    501
    Ok, sorry sent the first one from my phone so didnt want to type much. Here is more detail.

    I have a form that queries a table. I have used a split form so that on the right is the worksheet view of all the data in the table and if the click on a row it will load that individual record in the form on the right. So the right side is a regular form that displays the data in a more user friendly layout. On the right sid the top is where the data fields are from the table and beneath that is a subform that pulls records in from anther table. So we will call the main form the Cars form and the subform will be the communication table. In the subform I am using the form type: continuous form. So it shows all the communication we have had related to a car. One of the fields in the communication subform is called ComFlow. This tells us if it was a communication TO a customer of From a customer. I am trying to create a button on that subform that will filter the communications subform for only ComFlow = To ( and a different button for From). I will end up putting about 6 buttons just like these to filter the communications subform based on Whether it was To or From and what type of communication.
    Thanks for any help

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Maybe use Filter code in your button:

    Me.Filter = "ComFlow = 'To'"
    Me.FilterOn = True

  5. #5
    tagteam is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    501
    Yes, perfect. Thank you. I tried several different variations that were like that but couldn't quite get the syntax. This one works great.
    Thanks

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

Similar Threads

  1. Replies: 13
    Last Post: 03-09-2014, 02:11 AM
  2. Replies: 6
    Last Post: 11-18-2013, 12:03 PM
  3. Filter subform on button Click
    By atom in forum Forms
    Replies: 2
    Last Post: 04-18-2012, 09:43 AM
  4. Replies: 28
    Last Post: 03-08-2012, 06:47 PM
  5. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 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