Results 1 to 3 of 3

I have Problem in processing Dlookup Function

  1. #1
    Join Date
    Apr 2006
    Posts
    4

    I have Problem in processing Dlookup Function

    I have the following Code

    RESPONSE = DLookup("[Number]", "Mr_Nos_1", "[Dept] =" & Forms!MR_NOS!Dept)

    I am trying to get the Number from the domain Mr_nos_1 , by checking the dept which is already feeded in the form, and I get the following Run Time Error


    Run Time Error 2001: "You canceled the previous operation" .

    But When I move the creteria it run properly and return the first field in the domain.

    So, if you please you can advise me how to solve this problem.

  2. #2
    StepUP is offline Advanced Beginner
    Windows 7 64bit Access 2000
    Join Date
    Dec 2005
    Posts
    99
    If the Dept field is type text, add a single quote to the criteria:

    RESPONSE = DLookup("[Number]", "Mr_Nos_1", "[Dept] ='" & Forms!MR_NOS!Dept & "'")

  3. #3
    Join Date
    Apr 2006
    Posts
    4
    Thank you John F for this reply

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

Similar Threads

  1. Is there a function to do this....
    By Nowherefast in forum Access
    Replies: 2
    Last Post: 12-31-2008, 08:08 AM
  2. New Database - Batch processing
    By stevo2820 in forum Database Design
    Replies: 0
    Last Post: 04-30-2007, 02:22 AM
  3. SELECT FUNCTION help please
    By scott munkirs in forum Queries
    Replies: 0
    Last Post: 10-17-2006, 07:44 AM
  4. Replies: 1
    Last Post: 01-10-2006, 12:32 PM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 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
  •  
Tech Forums: Microsoft Office Forums