Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    33

    Unanswered: newbi query question

    Hi. I get an error (to complex...) on this query expression:

    ((GlobalPunchList.ProjectNo="SN-UT-004" AND GlobalPunchList.ProjectNo="SN-UT-005") AND [Forms]![GlobalPunchList Form]![Check94]=True)

    What is wrong?

  2. #2
    Join Date
    May 2012
    Posts
    33
    I like to find rows where ProjectNo = "SN-UT-004" from GlobalPunchList table.

    It fails when i write: GlobalPunchList.ProjectNo="SN-UT-004". It this wrong syntax?

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    ((GlobalPunchList.ProjectNo="SN-UT-004" AND GlobalPunchList.ProjectNo="SN-UT-005") AND [Forms]![GlobalPunchList Form]![Check94]=True)

    I think it's the last bit after the AND it have to point to feild in the table not a form
    What feild in the globalpunchlist should be true
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  4. #4
    Join Date
    May 2012
    Posts
    33
    Myle, it works fine with input from the form, but not with the = "SN-US-004". So i tried the LIKE function. Its not working correctly eiter. I tried this one: GlobalPunchList.ProjectNo LIKE "SN-US-004" No success...

  5. #5
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    Shouldn't you have an OR between the two GlobalPunchList.ProjectNo criteria (a field in a single record cannot have two values!)?


    MTB

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or better yet
    Code:
    GlobalPunchList.ProjectNo in ("SN-UT-004","SN-UT-005") AND [Forms]![GlobalPunchList Form]![Check94]=True
    same functionality, just easier to read in my books
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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