ACC2: "#Error" Running DLookup() Example in "User's Guide"

Last reviewed: April 2, 1997
Article ID: Q121783
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

Page 460 of the Microsoft Access version 2.0 "User's Guide" contains an example of using the DLookup() function to return the contact name of the supplier whose ID matches the value in the Supplier ID control on the Products form. This example contains a syntax error. The example incorrectly uses a period (.) instead of an exclamation point (!) to reference the Supplier ID field. If you use this example, you may receive a "#Error" message in the control on your form.

RESOLUTION

The correct syntax for the example is as follows.

NOTE: In the following example, an underscore (_) at the end of a line is used as a line-continuation character. Remove the underscore from the end of the line when re-creating this example.

   =DLookup("[Contact Name]","[Suppliers]","[Supplier _
    ID]=Forms![Products]![Supplier ID]")

STATUS

This behavior does not occur in Microsoft Access version 7.0.

REFERENCES

Microsoft Access "User's Guide," version 2.0, Chapter 18, "Using Expressions in Forms," page 460


Additional query words: pounderror kberrmsg
Keywords : DcmMnl kbusage
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.