Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntex (Access 97 sr2)

    HELP what am I doing wrong. I keep getting all of the roles with this code. I just want what is in the me![cborole] field

    DoCmd.OpenReport "Rpt: Underwriting Report - Dated Notes", acPreview, "", "[Qry: Underwriting Report - Dated Notes]![Method Decription]=""COMPETITIVE"" Or [Qry: Underwriting Report - Dated Notes]![Method Decription]=""NEGOTIATED""And [Qry: Underwriting Report - Dated Notes]![COMMERCE ROLE]= 'Me![cborole]'"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntex (Access 97 sr2)

    "And" has precedence over "Or", so A Or B And C is interpreted as A Or (B And C). I think that you want (A Or [img]/forums/images/smilies/cool.gif[/img] And C, you must use parentheses to accomplish that. Moreove, you must place Me!cboRole outside the quotes:
    <code>
    DoCmd.OpenReport "Rpt: Underwriting Report - Dated Notes", acPreview, , "([Qry: Underwriting Report - Dated Notes]![Method Decription]='COMPETITIVE' Or [Qry: Underwriting Report - Dated Notes]![Method Decription]='NEGOTIATED') And [Qry: Underwriting Report - Dated Notes]![COMMERCE ROLE]= '" & Me![cborole] & "'"
    </code>
    Note: I replaced your double double quotes with single single ones for consistency; this is not essential.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntex (Access 97 sr2)

    Thank you very much! You are the best. Basic order of operations, I just was not thinking. It works fine now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •