Results 1 to 2 of 2
  1. #1
    xmattxman is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2017
    Posts
    19

    multiple criteria in a dlookup

    I have been trying to add multiple criteria to a dlookup and cant get the syntax correct.



    Code
    On hand FG: DLookUp("ML_QTY","ML","[ML_IMKEY] = '" & [IM_Key] & "' and ML_LOCATION like 'B-*'")


    I need to add ML_LOCATION = 'FG' as well how do I add that?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if not IsNUll(cboST) then sWhere = sWhere & "[State]='" & cboST & "'"
    if not IsNUll(cboCity) then sWhere = sWhere & " and [city]='" & cboCity & "'"
    if not IsNUll(cboZip) then sWhere = sWhere & " and [ZipCode]='" & cboZip & "'"

    = DLookUp("ML_QTY","ML", sWhere )

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

Similar Threads

  1. DLookup Multiple Criteria
    By sergi117 in forum Access
    Replies: 1
    Last Post: 09-17-2018, 10:49 AM
  2. Dlookup multiple criteria
    By Zoona in forum Programming
    Replies: 5
    Last Post: 01-04-2017, 04:42 PM
  3. DLookup with multiple criteria
    By amai in forum Access
    Replies: 2
    Last Post: 12-20-2015, 02:10 PM
  4. Help with multiple criteria DLookup
    By jtm013 in forum Programming
    Replies: 7
    Last Post: 04-23-2015, 03:16 PM
  5. Using DLookup with multiple criteria
    By halt4814 in forum Access
    Replies: 2
    Last Post: 04-08-2013, 12:26 PM

Tags for this Thread

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