Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup (Access 2000)

    I have a DLookup control loooking for an orderid having Audit = true.I would like to add to it the orderdate, which is another field of the table.How could i add to this Lookup the order date writing also "from" before that ?
    My present and working code is :
    =DLookUp("orderid";"orders";"audit=True")

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: DLookup (Access 2000)

    You can have mutliple criteria in a dlookup, separated by "and " or "or".

    =DLookUp("orderid";"orders";"(audit=True) and (OrderDate etc)")

    The etc needs to be replaced by the condition you want to use.

    I don't understand from your post what condition you want to place on OrderDate.
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup (Access 2000)

    Thank you !

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: DLookup (Access 2000)

    BTW, in using DLookup like your are (to get an ID#, which I assume is the PK field here), you have no way of knowing which ID# you will be getting if more than one meets your criteria. That is, don't assume you will be getting the first ID in the table that meets your criteria. Depending on the criteria, DLookup might happen to return the first ID, the last ID, or something in the middle.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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