Results 1 to 2 of 2
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Dlookup expression.


    I have a few Dlookup expressions and they work correctly. I battle with one and don't see why. I have a table t01Payment, with Primary key field PmtID. Another field InvPchID01 keeps a reference to Inv no that is paid. In my PURCHASE INVOICE QUERY q02InvPurchase, I want to return the payment ID where InvPchID = InvPchID01.

    My expression DLookUp("[PmtID]","q02Payment","[ InvPchID01]=" & [InvPchID]) returns the error "The object doesn't contain the automation object InvPchID01. I simply checked it over and over for spelling error.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is there really a space in "[ InvPchID01]" in your code?

    You are doing lookup on a query, not the table. Are you sure the query has the field? Why don't you pull from table?
    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. Replies: 4
    Last Post: 06-26-2017, 12:19 PM
  2. Replies: 2
    Last Post: 05-27-2016, 06:10 PM
  3. Replies: 9
    Last Post: 12-30-2014, 11:58 AM
  4. Query Expression with IIF and DLOOKUP
    By bryan0 in forum Queries
    Replies: 7
    Last Post: 01-30-2014, 07:52 PM
  5. Dlookup Expression Help
    By chrismja in forum Queries
    Replies: 10
    Last Post: 10-29-2010, 03:42 PM

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