+ Reply to Thread
Results 1 to 3 of 3

Dlookup giving only first result from table

  1. #1
    Forum Contributor
    Join Date
    12-20-2019
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    116

    Dlookup giving only first result from table

    Hi,

    I am using Dlookup in access form on a combo-box (afterupdate macro) to populate the next related dropdown.
    But it only fetches the result of the first data entry in that column.

    ex:
    Column1 is Customer, Column2 is Product
    Cusomter Product
    THE Totality DEPOT/TED CROSS 12 X 12 ACTIVATOR WITH SLIT/1MSHTS
    THE Totality DEPOT/TED CROSS 12 X 18 ACTIVATOR WITH SLIT
    THE Totality DEPOT/TED CROSS 12 X 18 ACTIVATOR WITH SLIT (1000/BOX)
    THE Totality DEPOT/TED CROSS 12 X 18 ACTIVATOR WITH SLIT /1M SHTS
    THE Totality DEPOT/TED CROSS 12 X 18 ACTIVATOR WITH SLIT/1M SHTS
    THE Totality DEPOT/TED CROSS 12 X 24 ACTIVATOR WITH SLIT/1M SHTS



    Please Login or Register  to view this content.
    It only fetches 12 X 12 ACTIVATOR WITH SLIT/1MSHTS and not the rest, i.e. I want a "select * from customer_product where customer="THE Totality DEPOT/TED CROSS" event.
    Meaning all options to show in the dependant drop-down.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Dlookup giving only first result from table

    well of course it does! DLOOKUP() only returns one record. it always does. it's impossible to retrieve more than one record using that function in any capacity and in any office program. see the remarks section of MS's KB article here:

    https://support.microsoft.com/en-us/...b-bed10dca5937

  3. #3
    Forum Contributor
    Join Date
    12-20-2019
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    116

    Re: Dlookup giving only first result from table

    I solved it.

    While using combobox (in my case I have two)
    1. Producte <--- dependant combobox name
    2. Customere <--- Independant combobox name

    To fetch customer and product information from customer_product table, you can use the control source of the dependant combobox
    to write the following query:
    select customer, product from customer_product where customer = !customere

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Recorded macro not giving the same result as the by-hand result
    By dcwm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2019, 09:42 AM
  2. [SOLVED] IF(OR function keeps giving #VALUE! result
    By GHBrodbeck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-27-2018, 08:42 PM
  3. [SOLVED] Need Dlookup from one lookup value get result through 3 tables to different textbox
    By johnodys in forum Access Tables & Databases
    Replies: 3
    Last Post: 06-16-2014, 02:19 AM
  4. [SOLVED] Simple =Sum(B2:L2) result is not giving accurate result and =IMSUM(M2,O2) also.
    By SimonsGE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2013, 01:56 AM
  5. [SOLVED] Dlookup too slow with external table, need to speed up or find alternate method
    By Cyclops in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-25-2013, 02:41 PM
  6. Formula giving different result on two different pcs
    By mdooley in forum Excel General
    Replies: 2
    Last Post: 05-28-2012, 07:05 PM
  7. [SOLVED] Formula not giving me the right result
    By Steved in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-09-2006, 10:25 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1