Results 1 to 3 of 3
  1. #1
    mhs5466 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    6

    You cancelled the previous operation error in dlookup function

    Hi All,



    Can some body correct the following code please, as I am stuck with it...

    Me.RecomVendor = Nz(DLookup(Nz("RecommVendor", ""), "tblPettyCash", "[dn] = '" & Me!PCPNo & "'"), "")

    Note : All of them are text fields...

    I get " You cancelled the previous operation" error while i run it, please some body solve it for me, it will highly be appreciated.

    Thanx

    Sunny

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Your code is wrong:

    Me.RecomVendor = Nz(DLookup(Nz("RecommVendor", ""), "tblPettyCash", "[dn] = '" & Me!PCPNo & "'"), "")

    What you are saying if there is nothing in the field RecommVendor do not look in any field which would translate to

    Me.RecomVendor = Nz(DLookup("", "tblPettyCash", "[dn] = '" & Me!PCPNo & "'"), "")

    Should be

    Me.RecomVendor = Nz(DLookup("RecommVendor", "tblPettyCash", "[dn] = '" & Me!PCPNo & "'"), "")

    David

  3. #3
    mhs5466 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    6
    Thanx alot for replying David

    Its ok now, I have already solved it...actually it was my mistake that i was trying to retrive a field which was not available in the table, instead of RecommVendorName i was putting recmmvendor in the function.

    Any ways, I appreciate your help and support..

    Sunny

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

Similar Threads

  1. Replies: 3
    Last Post: 10-06-2009, 02:11 PM
  2. Previous value
    By yegnal in forum Forms
    Replies: 0
    Last Post: 07-22-2007, 07:51 AM
  3. Invalid Operation
    By ScottG in forum Forms
    Replies: 0
    Last Post: 11-14-2006, 02:05 PM
  4. I have Problem in processing Dlookup Function
    By Katada in forum Programming
    Replies: 2
    Last Post: 04-23-2006, 12:07 AM
  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
  •  
Other Forums: Microsoft Office Forums