Results 1 to 3 of 3
  1. #1
    halt4814 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    19

    Using DLookup with multiple criteria

    Hi,

    I am using MS Access 2010 and have an issue with one of my forms.
    First off, I have a table called coefficient which contains a column MIN, a column MAX, and a column COEFF.
    In my form, called CALC, I want to grab a number that it is in textbox [Text12] and place the related coefficient number in textbox [Text15].




    I placed a control source in [Text15] using =DLookup("[COEFF]","coefficient","[Text12]>[MIN] And [Text12]<[MAX]")

    It is throwing an error when I run the form.

    Any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Do not place variables within quotes, concatenate variables. Reference to control is a variable. Otherwise you have the literal string "[Text12]", not the value in [Text12].

    DLookup("[COEFF]", "coefficient", [Text12] & ">[MIN] And " & [Text12] & "<[MAX]")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    halt4814 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    19
    Worked great. Thanks!

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

Similar Threads

  1. Replies: 1
    Last Post: 01-31-2013, 04:56 AM
  2. Replies: 3
    Last Post: 08-22-2012, 03:51 PM
  3. dlookup with a contains criteria?
    By noretoc in forum Access
    Replies: 3
    Last Post: 05-02-2012, 10:18 AM
  4. Replies: 11
    Last Post: 04-30-2012, 07:22 PM
  5. Multiple criteria in DLookup
    By crowegreg in forum Forms
    Replies: 7
    Last Post: 06-22-2011, 01:47 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