Results 1 to 2 of 2

Thread: DLookup syntax

  1. #1
    Join Date
    Mar 2011

    Unanswered: DLookup syntax

    I have a DCount on a textbox on a form that is
    supposed to pull up the number of delegates scheduled or invited (status 1 or
    2) form a table tbleventdelegate. I have the following code:
    =DCount("[Status]","tblEventDelegate","[EventID]=" & [Forms]!
    [frmMainNavigation]![NavigationSubform]![EventID] & "AND [Status]=1 and 2")

    this only gives me 1 record when I can see there are 2 records one with a
    status of 1 and one with 2. I tried 1 or 2 but that brought up all the
    records and I tried 1,2 but that gave me a #type error in the box. I even
    tried 1 +2 but that only gave me 1 result on one record of the tbale
    presumably because there is a rceord with a status of 3 for it. I'm sure this
    is an easy solution but I can't find the answer. Thanks in advance to anyone

  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    Resolved elsewhere:

    =DCount("[Status]","tblEventDelegate","[EventID]=" & [Forms]![frmMainNavigation]![NavigationSubform]![EventID] & " AND ([Status]=1 or [Status] =2)")

Posting Permissions

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