Results 1 to 4 of 4
  1. #1
    BFlat is offline Novice
    Windows 2K Access 2003
    Join Date
    Mar 2012
    Posts
    20

    Report with 3 criteria

    I am trying to open a report base on 3 criteria as follows:


    DoCmd.OpenReport "rpt_sumReadmissionDate", acViewPreview, , ("[Source]<>' Non-Collaborative Facility' And [CurrentAdmit]-[DischargeDate]>2 And [Home]<>'Yes'")

    The first two criteria work fine but when I added the third criteria hundreds of records dropped form the report although majority of the records in the database meet all three criteria.

    I'm not sure what I am doing wrong of if access allows for 3 criteria. PLEASE HELP

  2. #2
    dbdesign is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Location
    CT
    Posts
    5
    Perhaps you can put that criteria right in the query that runs the report instead? If you have different criteria for different situations, use the RecordSource

    If Whatever Then
    DoCmd.OpenReport "rpt_sumReadmissionDate", acViewPreview
    Me.RecordSource="Query1"
    Else
    DoCmd.OpenReport "rpt_sumReadmissionDate", acViewPreview
    Me.RecordSource="Query2"
    End If

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Do you have any NULL fields in your [Home] field? That often messes with criteria and you need to explicitly account for it, i.e.

    ...And ([Home]<>'Yes' Or Is Null"))


  4. #4
    BFlat is offline Novice
    Windows 2K Access 2003
    Join Date
    Mar 2012
    Posts
    20
    Cheers! I did have some null fields. Thanks for your help.

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

Similar Threads

  1. Replies: 18
    Last Post: 07-18-2012, 01:08 PM
  2. report Criteria issue
    By manic in forum Reports
    Replies: 2
    Last Post: 02-15-2012, 10:02 PM
  3. Criteria for Report/Query being ignored
    By yes sir in forum Access
    Replies: 2
    Last Post: 10-05-2010, 03:57 PM
  4. Want certain criteria to appear on report.
    By kenanselo in forum Reports
    Replies: 4
    Last Post: 01-18-2010, 02:48 PM
  5. Run Report with Prompt for Field Criteria
    By diane802 in forum Reports
    Replies: 4
    Last Post: 01-15-2010, 02:31 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