ACC1x: Description of CreateForm() and CreateReport() Functions

Last reviewed: June 8, 1997
Article ID: Q109395
The information in this article applies to:
  • Microsoft Access versions 1.0 and 1.1
  • Microsoft Access Distribution Kit version 1.1

SUMMARY

This article describes the CreateForm() and CreateReport() functions that are documented in the "The Secrets of Access Wizards" manual which is included with the Microsoft Access Distribution Kit.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual.

CreateForm(), CreateReport() Functions

Description   Creates a new form or report and returns a form or
              report object.

Syntax        CreateForm([database [,formtemplate]])

              CreateReport([database [, reporttemplate]])

Remarks       The CreateForm() and CreateReport() functions use the
              following arguments:

              Argument         Description
              --------------------------------------------------------
              database         String expressions identifying the name
                               of the database that contains the form
                               or report template; if the argument is
                               omitted, the current user database (the
                               same value as returned by the CurrentDB
                               function) is used.

              formtemplate,    String expression identifying the name
              reporttemplate   of the form or report template, the
                               name of a form or report, or the word
                               Normal. If the expression is omitted,
                               Access Basic uses the form or report
                               template set with the Options command
                               on the View menu.

              These functions are the equivalent of choosing New Form
              and New Report from the File menu in the Database
              window. They return a form or report object. Use these
              functions in Design Mode only.

Example       Creates a report in the user database using the Normal
              template.

   Sub NormalReport()
       Dim MyReport As Report
       ' CreateReport function creates a minimized report
       ' that we need to restore.
       Set MyReport = CreateReport("","")
       DoCmd Restore
   End Sub

REFERENCES

Microsoft Access "The Secrets of Access Wizards," page 15


Additional query words: ADK
Keywords : kbprg PgmOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


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