Trying to use DLookup for control source of a field on a report

Posted on 2011-10-26
Last Modified: 2013-11-05
Can someone tell me what is wrong with this...

 =DLookUp("[Qty]", "tblPrintOrdTranx", "[PartN] = Forms!frmEnterJobNumber.cbojobn.column(1)

Note:  PartN is a text field.

Question by:SteveL13
    LVL 33

    Expert Comment

    =DLookUp("[Qty]", "tblPrintOrdTranx", "[PartN] =" & Forms!frmEnterJobNumber.cbojobn.column(1))
    LVL 61

    Expert Comment

    =DLookUp("[Qty]", "tblPrintOrdTranx", "[PartN] = '" Forms!frmEnterJobNumber.cbojobn.column(1) & "'"

    You need quotes for text fields
    LVL 61

    Accepted Solution


    =DLookUp("[Qty]", "tblPrintOrdTranx", "[PartN] = '" & Forms!frmEnterJobNumber.cbojobn.column(1) & "'")
    LVL 19

    Expert Comment

    Try this if your PartN is a text value.

    =DLookUp("[Qty]", "tblPrintOrdTranx", "[PartN] ='" & Forms!frmEnterJobNumber.cbojobn.column(1) & "'")


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now