Results 1 to 2 of 2
  1. #1
    petertje is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    5

    Question dlookup columns matching


    I came across this problem today and i haven't found anything about this on the microsoft page or on this forum .

    This is the table:

    car_number //////car_total

    11///// 7
    11///// 6
    11//// / 5
    12 ///// 4
    12///// 5

    Function:



    DLookup(expr, domein [, criteria] )

    I have two textboxes in a form the first one is the one you can put in your car_number and in the other one you can put in your car_total


    so when somebody types in his car_number and his car_total I first whant to filter with car_number and then match what is filled into the textbox car_total with what is in the database.

    At the moment I' m using this.

    " cartotal = " & me.cartotal"

    But this value gives me all the values of all the car_total that has been filled into the textbox, but I whant the one that matches car_total and car_numbers


    so in this case:

    If textbox car_number is filled in with 11
    and the textbox car_total is filled with 5

    Then I whant it to return 5 and not twice 5

    Thanks in advance!

    -Petertje

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,621
    You want to enter two values into UNBOUND controls and use them as filter criteria to retrieve record?

    A parameterized query is one way:

    SELECT * FROM table WHERE car_number = Forms!formname!tbxCarNum AND car_total = Forms!formname!tbxCarTot;

    That query can be RecordSource for a form or report.
    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.

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

Similar Threads

  1. Matching or Dlookup?
    By 201034 in forum Queries
    Replies: 3
    Last Post: 07-18-2012, 06:06 AM
  2. matching part of the string from two columns
    By hoachen in forum Queries
    Replies: 4
    Last Post: 12-20-2011, 01:54 PM
  3. Replies: 1
    Last Post: 10-24-2011, 08:01 AM
  4. Replies: 1
    Last Post: 08-11-2011, 11:33 AM
  5. Matching between 2 tables
    By slevin in forum Access
    Replies: 1
    Last Post: 06-16-2010, 07:28 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