E.20. The Reports Collection and Report Object

Microsoft Access contains a Reports collection that contains a Report object for every report within your database.

E.20.1. Properties of the Report Object

The properties of the Report object are listed in the following table.

PropertyData TypeDescription
ActiveControlControl objectUsed with the Screen object to determine the control that has the focus
ApplicationApplication objectReturns the currently active application object
AutoCenterBooleanDetermines whether the report will be automatically centered within the Application window
AutoResizeBooleanDetermines whether the report will be automatically resized to display complete records
BorderStyleByteSpecifies the type of border and border elements for the report
CaptionStringSpecifies the caption in the title bar for the report
CloseButtonBooleanSpecifies whether the Close button on a report is enabled
ControlBoxBooleanSpecifies whether the form has a control menu (in form and datasheet view only)
ControlsControls collectionSpecifies the collection of all controls on the report
CountIntegerSpecifies the number of items within the Reports collection
CurrentRecordLongUsed to identify the current record being viewed on a report
CurrentXSingleUsed to specify the horizontal coordinates for the starting position of the next printing and drawing method on a report
CurrentYSingleUsed to specify the vertical coordinates for the starting position of the next printing and drawing method on a report
DateGroupingByteSpecifies how you want to group dates on a report
DefaultControlControl objectCan be used to specify the properties of a particular type of control on a report
DirtyBooleanTrue if data has been entered but not saved on a form
DrawModeIntegerSpecifies how the pen interacts with existing background colors on a report when the Line, Circle, or Pset method is used when printing
DrawStyleIntegerSpecifies the line style when using the Line and Circle methods to print lines on reports
DrawWidthIntegerSpecifies the line width for the Line, Circle, and Pset methods to print lines on reports
FastLaserPrintingBooleanSpecifies whether lines and rectangles are replaced by text character lines to speed printing
FillColorLongSpecifies the color that fills in boxes and circles drawn on reports with the Line and Circle methods
FillStyleIntegerSpecifies whether circles and lines are transparent, opaque, or filled with a pattern
FilterStringUsed to specify a subset of records to be displayed when a filter is applied to a report
FilterOnBooleanSpecifies whether the Filter property of a report is applied
FontBoldBooleanSpecifies whether a font appears in bold on a form or report
FontItalicBooleanSpecifies whether a font appears in italics on a form or report
FontNameStringSpecifies the font for printing controls on reports
FontSizeIntegerSpecifies the font size for printing controls on reports
FontUnderlineBooleanSpecifies whether a font appears underlined on a form or report
ForeColorLongSpecifies the color for text in a control
FormatCountIntegerSpecifies the number of times the OnFormat property has been evaluated for the current section on a report
GridXIntegerSpecifies the horizontal divisions of the alignment grid in report design view
GridYIntegerSpecifies the vertical divisions of the alignment grid in report design view
GroupLevelGroupLevel objectRefers to a particular group level you're grouping or sorting in a report
GrpKeepTogetherByteSpecifies whether groups in a multiple column report that have the KeepTogether property set to Whole Group or With First Detail will be kept together by page or by column
HasDataLongSpecifies if a report is bound to an empty recordset
HasModuleBooleanSpecifies whether a report has a class module associated with it
HeightIntegerSpecifies the height of the report in twips
HelpContextIDLongSpecifies the context ID of a topic in the custom help file
HelpFileStringReturns the name of the help file associated with the report
HwindLongUsed to determine the handle of the current window
InputParametersStringCan be used to specify the input parameters passed to a SQL statement in the RecordSource property of a report
LayoutForPrintBooleanSpecifies whether the report uses printer (True) or screen (False) fonts
LeftIntegerSpecifies the object's location on a report
MenuBarStringSpecifies the menu bar to use for a report
MinMaxButtonsByteSpecifies whether the Maximize and Minimize buttons are visible on the report
ModalBooleanSpecifies whether a report opens as a modal window
ModuleModule objectUsed to specify a module for the report
MoveableBooleanTrue if a report can be moved by the user
MoveLayoutBooleanSpecifies if Access should move to the next printing location on the page
NameStringSpecifies the name of the report
NextRecordBooleanSpecifies whether a section should advance to the next record
ObjectPaletteStringString property containing the palette information
OnActivateStringIndicates which macro, event procedure, or user-defined function runs when the OnActivate event occurs
OnCloseStringIndicates which macro, event procedure, or user-defined function runs when the OnClose event occurs
OnDeactivateStringIndicates which macro, event procedure, or user-defined function runs when the OnDeactivate event occurs
OnErrorStringIndicates which macro, event procedure, or user-defined function runs when the OnError event occurs
OnMenuStringIndicates which macro, event procedure, or user defined function runs when the OnMenu event occurs
OnNoDataStringIndicates which macro, event procedure, or user-defined function runs when the OnNoData event occurs
OnOpenStringIndicates which macro, event procedure, or user-defined function runs when the OnOpen event occurs
OnPageStringIndicates which macro, event procedure, or user-defined function runs when the OnPage event occurs
OpenArgsVariantDetermines the string expression specified by the OpenArgs method of the OpenReport method
OrderByStringSpecifies how records on a report should be shortened
OrderByOnBooleanSpecifies whether the OrderBy property is applied.
OrientationByteSpecifies the report's orientation (left to right or right to left)
PageLongSpecifies the current page number when a report is printed
PageFooterByteSpecifies whether a report's page footer is printed on the same page as the report footer
PageHeaderByteSpecifies whether a report's page header is printed on the same page as the report header
PagesIntegerReturns information needed to print page numbers on a report
PaintingBooleanSpecifies whether reports are repainted
PaintPaletteVariantSpecifies the palette used by a report
PaletteSourceStringUsed to specify the palette for the report
ParentApplication objectThe Application object is the parent of the report
PictureStringCan be used to specify a bitmap on a report
PictureAlighmentByteSpecifies where a background picture appears in an image control on a report
PictureDataVariantCan be used to copy the picture in a report to another object
PicturePagesByteSpecifies on which page or pages of a report a picture is displayed
PicturePaletteStringContains information about the palette for the object
PictureSizeModeIntegerSpecifies how a picture on a report is sized
PictureTilingBooleanSpecifies whether a background picture is tiled across the entire report
PictureTypeByteSpecifies whether Access stores a report's picture as a linked or embedded object
PopUpBooleanSpecifies whether a report opens in a pop-up window
PrintCountIntegerSpecifies the number of times the OnPrint property has been evaluated for the current section of the report
PrinterPrinter objectRepresents the default printer on the current system
PrintSectionBooleanSpecifies whether a section of a report should be printed
PropertiesProperties collectionRepresents the collection of all properties for the report
PrtDevModeVariantSets or returns the printing device mode information for the report in the Print dialog
PrtDevNamesVariantSets or returns information about the printer selected in the Print dialog
PrtMipVariantSets or returns the printing device mode information for the report in the Print dialog
RecordLocksIntegerDetermines how records are locked and what happens when two users try to edit the same record at the same time
RecordsetRecordset objectReturns the Recordset object for the report
RecordSourceStringUsed to specify the source of the data for the report
RecordSourceQualifierStringReturns or sets a string indicating the SQL Server owner name of the record source for the report
ReportReport objectUsed to refer to the report associated with a subreport
ScaleHeightSingleSpecifies the number of units for the vertical measurement of the page when the Circle, Line, Pset, or Print methods are used when a report is printed
ScaleLeftSingleSpecifies the units for the horizontal coordinates that reference the location of the left edge of the page when the Circle, Line, Pset, or Print methods are used when a report is printed
ScaleModeIntegerSpecifies the unit of measurement for coordinates on a page when the Circle, Line, Pset, or Print methods are used when a report is printed
ScaleTopSingleSpecifies the units for the vertical coordinates that reference the location of the top edge of a page when the Circle, Line, Pset, or Print methods are used on a report
ScaleWidthSingleSpecifies the number of units for the horizontal measurement of the page when the Circle, Line, Pset, or Print methods are used when a report is printed
SectionSection objectUsed to identify a section of a report
ServerFilterStringUsed to specify a subset of records displayed when a server filter is applied
ShapeStringSpecifies the shape command corresponding to the sorting and grouping of the report
ShortcutMenuBarStringSpecifies the shortcut menu that appears when you right-click a report
TagStringStores extra information about a report
ToolbarStringSpecifies the toolbar used for a report
TopLongSpecifies the report's top coordinates
UseDefaultPrinterBooleanDetermines whether the report uses the system's default printer
VisibleBooleanTrue when the report isn't minimized
WidthIntegerWidth of the report in twips
WindowHeightIntegerSpecifies the height of a report in twips
WindowLeftIntegerIndicates the screen position in twips of the left edge of the report relative to the left edge of the Access window
WindowTopIntegerSpecifies the screen position in twips of the top edge of the report relative to the top edge of the Access window
WindowWidthIntegerSets the width of the report in twips

E.20.2. Methods of the Report Object

The methods of the Report object are listed in the following table.

MethodArgumentsDescription
CircleFlags, X, Y, radius, color, start, end, aspectDraws a circle, ellipse, or an arc on a report when the print event occurs
LineFlags, x1, y1, x2, y2, colorDraws lines and rectangles on a report when the print event occurs
MoveLeft, top, width, heightMoves the report to the specified coordinates on the screen
PrintExprPrints text on a report object using the current color and font
PSetFlags, X, Y, colorSets a point on a report object to the specified color when the Print event occurs
ScaleFlags, x1, y1, x2, y2Defines the coordinate system for a report object
TextHeightExprReturns the height of a text string as it would be printed in the current font of a report
TextWidthExprReturns the height of a text string as it would be printed in the current font of a report

E.20.3. Events of the Report Object

The events of the Report object are listed in the following table.

EventDescription
ActivateOccurs when a report receives the focus and becomes the active window
CloseOccurs when a report is closed but before it is removed from the screen
DeactivateOccurs when a report loses focus to another object
ErrorOccurs when a runtime error occurs when the report has the focus
NoDataOccurs after a report with no data is formatted for printing but before the report is printed
OpenOccurs when a report is opened but before it is displayed on the screen
PageOccurs after a page is formatted for printing but before the page is printed

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.3.255