Results 1 to 4 of 4
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Open Form and filter subform

    I am using A2007 with W7. I am trying to open a form that contains a subform and have the subform filtered to match a value in a combobox. The Parent is named "F_SoldSails" and subform is "F_SoldSails_Sub". (Single Format). I am using the code below that I got from another website

    strFilter = "boat_type= """ & Me.BoatTypeBox.Column(1) & """"
    DoCmd.OpenForm "F_SoldSails"
    Forms!F_SoldSails![F_SoldSails_Sub].Form.Filter = strFilter
    Forms!F_SoldSails![F_SoldSails_Sub].Form.FilterOn = True

    It opens the form and filters to the selected boat, but filters the subform to just one record when there may be 25 boat_types that match strFilter. Doing something wrong or a glitch in my file? Any help much appreciated

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Are there master/child links that are restricting the subform before this is applied?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Thanks for quick reply-The forms were smple enough that I just redid the whole thing and code works fine. At this pooint, I am not sure where I clicked or mis-entered to screw up on the first pass. Again, thanks for looking at it.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 08-01-2011, 04:17 PM
  2. Replies: 1
    Last Post: 11-30-2010, 10:05 AM
  3. Replies: 1
    Last Post: 11-16-2010, 08:42 AM
  4. filter when i open form
    By Balen in forum Forms
    Replies: 0
    Last Post: 08-12-2010, 02:31 PM
  5. How to open a form with filter applied?
    By rkm360 in forum Access
    Replies: 1
    Last Post: 03-18-2009, 09:27 AM

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