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

ID: Q121783


The information in this article applies to:


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          : kbusage 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 7, 1999