Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,080

    Filter not being passed

    I can't figure out why a filter expression is not being passed to a report. In the segment of code below, I verify the contents of the filter string with a simple display:

    Code:
    Public Function lbl12()
    MsgBox FilterName
    DoCmd.OpenReport "lblAddrLabels12", acViewPreview, FilterName
    End Function
    Likewise, when the report opens:

    Code:
    Private Sub Report_Open(Cancel As Integer)
    MsgBox Me.Filter
    Me.FilterOn = True
    End Sub
    The filter is correct in the statement before the DoCmd, but empty when the filter is displayed when the report opens.

    I don't know how much more simple this could be, yet I'm mystified as to what is happening. (The RecordSource for the report is clearly defined.)



    Any ideas?

    Thanks,
    Bill

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,080
    That's essentially what I'm doing. The filter string in my post "Filtername" is Dim'd as string and in the current case the value of the string is something like "Business = True".

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,080
    The filter expression is the 4th argument to DoCmd.OpenReport, NOT the 3rd!!!!!!!!!

    The 3rd is the filter name...............not sure at this moment that I've yet learned the difference.

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

Similar Threads

  1. How do I use a passed parameter in a Case statement
    By tarenja in forum Programming
    Replies: 7
    Last Post: 08-04-2013, 10:49 PM
  2. Replies: 3
    Last Post: 02-24-2012, 01:23 PM
  3. Counting Results: Passed/Failed!
    By cap.zadi in forum Queries
    Replies: 4
    Last Post: 12-05-2011, 12:20 PM
  4. Select Query with lookup params passed from form
    By sariahdog in forum Queries
    Replies: 0
    Last Post: 07-18-2011, 09:10 AM
  5. Form Data Not being passed onto query
    By fmoses in forum Queries
    Replies: 2
    Last Post: 08-20-2009, 08:33 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