Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442

    Here's my sample database

    EDIT: this is why I use queries and not filters. Queries are sooooooo much easier to handle.

  2. #17
    Callahan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    25
    Thanks again rpeare, this is what worked for me:
    Function inventoryrptfilter()
    On Error GoTo inventoryrptfilter_Err
    Dim sFilter As String
    If Me.Filter = "" Then
    MsgBox "Apply a filter"
    Else
    sFilter = Me.Filter
    DoCmd.OpenReport "INVENTORYreport1", acViewPreview
    With Reports![INVENTORYreport1]
    .Filter = sFilter
    .FilterOn = True
    End With
    DoCmd.OpenReport "INVENTORYreport1", acViewPreview
    End If

    inventoryrptfilter_Exit:
    Exit Function
    inventoryrptfilter_Err:
    Me.Filter = ""
    MsgBox Error$
    Resume inventoryrptfilter_Exit
    End Function

    It's got some crazy shxt in it, like opening the report, and then opening the report again, but it is working so far. Since I have some 50 or 60 filters like this in my app, I don't want to go changing them to queries.

    Anyway I do appreciate your replies, with this 2010 thang, lots of folks like me will be a using forums like this for a while and a half. So go ahead, and make my day.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Reports - Applying a subform filter
    By AMCUser in forum Queries
    Replies: 13
    Last Post: 06-25-2010, 07:32 PM
  2. how to pass pk to subform
    By ahmed.gomaa in forum Forms
    Replies: 9
    Last Post: 03-21-2010, 10:03 AM
  3. Replies: 7
    Last Post: 05-24-2009, 10:24 AM
  4. Replies: 1
    Last Post: 03-01-2009, 09:53 AM
  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