+ Reply to Thread
Results 1 to 5 of 5

Database Dlookup() Function throwing Error

  1. #1
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Database Dlookup() Function throwing Error

    Very simple but I don't know what I am missing? It's throwing error
    Attached Images Attached Images


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Database Dlookup() Function throwing Error

    Oopss... I got it

    I am just missing the single quotes

    Q: DLookUp("[Order]","tDesg","[Desg]='" & [RDesg] & "'")
    Last edited by :) Sixthsense :); 02-16-2015 at 02:30 AM.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Database Dlookup() Function throwing Error

    Hi,

    I'd first try to replace the [DResg] with a number or word and see if Access likes it.

    Access is all about naming conventions. Second I'd try to put Forms.[DResg] in the build function.

    Third - Instead of using DLookup between two table, bring the second table into the query and link two fields together and then drag both down to the field area and make the criteria correct for the field you want.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Database Dlookup() Function throwing Error

    Glad you got this one on your own. Syntax and building queries in Access is harder than in Excel.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Database Dlookup() Function throwing Error

    Thanks for joining in my thread and offering some more tips on my question

    Quote Originally Posted by MarvinP View Post
    I'd first try to replace the [DResg] with a number or word and see if Access likes it.
    Yes, you are right numbers don't need single quote in DLookup() Criteria but Text needs single quotes

    Quote Originally Posted by MarvinP View Post
    Third - Instead of using DLookup between two table, bring the second table into the query and link two fields together and then drag both down to the field area and make the criteria correct for the field you want.
    I kept it in the same way as you described, but after that I realized keeping link between two tables created a problem. I will explain the problem I faced because of the linking...

    I kept Designations in a table with Serial Numbers (For Sorting based on levels) so that users can add or delete the designations as per their requirements. So based on that the Employees Designation entry Drop Down List will populate the current Designations at the time of creating new employee.

    I kept both the designations and the employees entry linked each other and made some entry and it seemed to be working fine.

    But the real problem was identified when I change/add the designation order and the sl number in the designation table then all the data in the employee table reflected a new value instead of the actually picked value.

    For example:

    When I did entry in employee table I selected Manager which is 2 in sl number
    I Changed the Designation table with Manager as sl.no 5 and VP as 2
    In the next second all the entries in the employee table was automatically changed to VP instead of the actual entry Manager

    May be I did something wrong while building relationship. But I don't know what it is...

    So I completely stopped using Links and trying to make use of Functions

+ 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. [SOLVED] This Code Is Throwing An Error At The End...
    By Regular_Joe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2014, 11:15 AM
  2. [SOLVED] Countif function throwing error with named range
    By keithmacd in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-18-2013, 07:21 AM
  3. =LEFT function throwing up error
    By mcp2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2013, 12:32 PM
  4. [SOLVED] DLookUp function
    By rmachbitz in forum Access Tables & Databases
    Replies: 4
    Last Post: 07-02-2013, 06:30 PM
  5. Combine a Dlookup with DMAX function
    By ca1358 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2006, 06:15 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