Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with Dlookup Formt? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the following command in a form and it works OK

    <pre>If Not IsNull(DLookup("strRefNo", "tbl_RevTran_Detail", _
    "strRefNo= " & Me.strRefNo & "")) Then
    </pre>


    I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help with Dlookup Formt? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Since strTranCode2 is a text field, the value must be enclosed in quotes; you can use single quotes or double double quotes within the string, or concatenate with Chr(34). For example:
    <code>
    If Not IsNull(DLookup("strRefNo", "tbl_RevTran_Detail", _
    "strRefNo=" & Me.strRefNo & " and strTranCode2=" & Chr(34) & Me.strTranCode2 & Chr(34))) Then
    </code>
    (Note: if strRefeNo is numeric, you don't need quotes around it; if it is text, you need quotes there too.)

Posting Permissions

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