Results 1 to 3 of 3
  1. #1
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63

    Open with OR criteria

    I've looked all over the forum and can't seem to find a similiar soultion anywhere. I am trying to open a report "Current" where "Type" is equal to Small or Medium. The code I've entered is:
    DoCmd.OpenReport "Current", acViewPreview, , [Type] = 'Small' Or [Type] = 'Medium' but I haven't had much success. Please help

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    The wherecondition is a string argument. Try

    DoCmd.OpenReport "Current", acViewPreview, , "[Type] = 'Small' Or [Type] = 'Medium'"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    BE aware that "Current" and "Type" are reserved words in Access and shouldn't be used as object names.
    See: http://allenbrowne.com/AppIssueBadWord.html
    Last edited by ssanfu; 05-31-2012 at 02:45 PM. Reason: computer can't spell

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

Similar Threads

  1. Open 1 of 2 Forms based on Criteria
    By DCV0204 in forum Forms
    Replies: 28
    Last Post: 11-23-2011, 03:09 PM
  2. Open 2nd Form with 2 criteria?
    By Robeen in forum Forms
    Replies: 1
    Last Post: 09-19-2011, 10:20 AM
  3. Open (sub)form linking 2 criteria on current form
    By websterh in forum Programming
    Replies: 2
    Last Post: 02-07-2011, 11:56 PM
  4. Replies: 1
    Last Post: 07-02-2010, 03:55 AM
  5. Open form based on Subform criteria
    By Suzan in forum Programming
    Replies: 0
    Last Post: 04-25-2006, 02:28 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