ACC1x: Cannot Use First() and Last() Functions in a Report

Last reviewed: May 14, 1997
Article ID: Q103190
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

Microsoft Access returns a #ERROR message in your Report field when you use First() or Last() functions.

RESOLUTION

It may be possible to use DFirst() or DLast() domain aggregate functions to achieve the results you want. However, these functions ignore any sorting or grouping in your report. You may need to supply a criteria to these domain functions to return the data desired.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

  1. Open the sample database NWIND.MDB.

  2. Open the Alphabetical List of Products report in Design view.

  3. Add an unbound text box to the Report Header section as follows:

          Object: Text Box
          ----------------
          ControlName: First Product
          ControlSource: =First([Product Name])
    

  4. From the File menu, choose Print Preview.

    The text box that you added, First Product, evaluates to #ERROR.

REFERENCES

Microsoft Access "Language Reference," versions 1.0 and 1.1, page 139


Additional query words: first last pounderror
Keywords : kbusage RptSort
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
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 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.