DoCmd.OpenReport Method (Access)
The OpenReport method carries out the OpenReport action in Visual Basic.
식 .OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)
식 A variable that represents a DoCmd object.
A string expression that's the valid name of a report in the current database. If you execute Visual Basic code containing the OpenReport method in a library database, Microsoft Access looks for the report with this name, first in the library database, then in the current database.
A AcView constant that specifies the view in which the report will open. The default value is acViewNormal.
A string expression that's the valid name of a query in the current database.
A string expression that's a valid SQL WHERE clause without the word WHERE.
A AcWindowMode constant that specifies the mode in which the form opens. The default valus is acWindowNormal.
Sets the OpenArgs property.
You can use the OpenReport method to open a report in Design view or Print Preview, or to print the report immediately. You can also restrict the records that are printed in the report.
The maximum length of the WhereCondition argument is 32,768 characters (unlike the Where Condition action argument in the Macro window, whose maximum length is 256 characters).