Results 1 to 9 of 9
  1. #1
    LOIZOS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2014
    Posts
    17

    Dlookup Criteria

    Hi
    I am using the following statement and I am not getting the correct information
    =DLookUp("Katanalosi";"TBL_KATANALOSI";"Customer_C ode=" & "Code" And "Paroxi=" & [counter])

    The problem is my criteria.
    It seems that the AND is not working

    [Customer_Code] (NUMBER)
    [Paroxi] (Short Text)
    are primary and Secondary keys in TBL_KATANALOSI table




    Pls help

    Thanks

    Loizos

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Maybe:
    =DLookUp("Katanalosi";"TBL_KATANALOSI";"Customer_C ode=" & Me.Code & " And Paroxi='" & [counter] & "'")

    EDIT:
    The space in:
    "Customer_C ode=

    should not be there but for some reason I can not remove it
    Last edited by Bob Fitz; 05-14-2017 at 09:02 AM. Reason: clarification
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Quote Originally Posted by Bob Fitz View Post

    The space in:
    "Customer_C ode=

    should not be there but for some reason I can not remove it
    The forum software does that sometimes. Code tags will avoid it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by pbaldy View Post
    The forum software does that sometimes. Code tags will avoid it.
    Thanks for the advice Paul.
    A good reason for using the tags at all times, even if it is only one line.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    It seems like if there are X number of characters without a space, the forum forces one. It's a feature, not a bug.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    LOIZOS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2014
    Posts
    17
    Thanks Bob

    Is not working. I am getting an #error

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Where are you using the expression
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    LOIZOS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2014
    Posts
    17
    I am using the expression in a form.
    I changed the expression
    =DLookUp("[Katanalosi]";"TBL_KATANALOSI";"[Paroxi]='01.03'" & " And [Customer_code]=227")
    and I am getting the correct ingormation but when I changed to the following I am getting a null value why??
    =DLookUp("[Katanalosi]";"TBL_KATANALOSI";"[Paroxi]='Counter'" & " And [Customer_code]=[code]")

  9. #9
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    "([paroxi]='" & counter & "' and [customer_code] = " & code &")"

    For the where part?

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

Similar Threads

  1. Dlookup criteria
    By aceSoft in forum Access
    Replies: 3
    Last Post: 04-15-2017, 10:16 PM
  2. Dlookup criteria with OR function
    By Bkper087 in forum Access
    Replies: 1
    Last Post: 03-27-2017, 07:22 PM
  3. Dlookup multiple criteria
    By Zoona in forum Programming
    Replies: 5
    Last Post: 01-04-2017, 04:42 PM
  4. DLookup with two criteria
    By craig1988 in forum Programming
    Replies: 1
    Last Post: 01-29-2015, 09:01 AM
  5. dlookup with a contains criteria?
    By noretoc in forum Access
    Replies: 3
    Last Post: 05-02-2012, 10:18 AM

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