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

ID: Q90139


The information in this article applies to:


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          : kberrmsg kbusage ExrOthr 
Version           : 1.0 1.10 2.0 7.0 97
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: March 11, 1999