Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Posts
    59

    Unanswered: Using WHERE clause in DLookup function

    Can someone please help me with completing this function? I am so close to getting this database but still keep having little problems, especially with Visual Basic!

    I currently have this line on one of my forms:

    If (Nz(DLookup("URN", "tblSrvRspns", "URN = " & Me!cboURN), 0) = 0) Then

    However I need for this lookup to include WHERE SrvID = Me!cboSrvID.

    SrvID is also in the tblSrvRspns table. The query will hopefully then translate as when there are zero entries of URN (as specified in Me!cboURN) in tblSrvRspns When SrvID, also in tblSrvRspns, equals Me!cboSrvID.

    If someone can please help me with this I will be extremely grateful!!!

    Thanks!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Try

    DLookup("URN", "tblSrvRspns", "URN = " & Me!cboURN & " AND SrvID = " & Me!cboSrvID)
    Paul

  3. #3
    Join Date
    Nov 2008
    Posts
    59
    You're a genius!

    Thank you very much! I am so close to finishing this database now, it is very exciting!

    Thanks again

Posting Permissions

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