ACC: "#Error" Message Using TRIM() Function in Form or Report

Last reviewed: May 7, 1997
Article ID: Q90139
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

If you have a form or report that has its RecordSource property defined as a table that contains no records, "#Error" is displayed when you preview the report or view the form in Form view if a bound control is defined by using the Trim() function.

CAUSE

When you use an expression to define the ControlSource property for a form or report, Microsoft Access evaluates the expression and presents the result for the control. If a blank field is evaluated, "#Error" appears.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a table with two text fields named Field1 and Field2.

  2. Create a report based on this table.

  3. Add the Field1 and Field2 fields to the detail section of the report.

  4. Modify the ControlSource property for the Field1 field as follows:

         =Trim([Field1])
    

  5. Preview the report. Note that the Field1 field contains #Error and that the Field2 field is blank.

  6. Create a form based on the table.

  7. Add the Field1 and Field2 fields to the form.

  8. Repeat step 4.

  9. View the form in Form view. Note that the Field1 field contains #Error and that the Field2 field is blank.

REFERENCES

For more information about the Trim() function, search for "trim" using the Microsoft Access Help menu.


Additional query words: pounderror
Keywords : ExrOthr kberrmsg kbusage
Version : 1.0 1.10 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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: May 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.