Creating Web Pages from Access Objects
You can create either static or dynamic reports for the Web from Access. The following sections outline ways to create either type.
Creating Static Web Pages
To create a static Web page from Access, you have three options:
You can export a table or query as an HTML file by using the TransferText method of the DoCmd object:
DoCmd.TransferText acExportHTML, , "Products", "Products.htm"
You can output a table, query, form, or report as an HTML file by using the OutputTo method of the DoCmd object:
DoCmd.OutputTo acOutputTable, "Products", acFormatHTML, _ "Products.htm"
You can output a report as a report snapshot, and then embed the report snapshot in a data access page by using the Snapshot Viewer ActiveX control. See the previous section, "Creating a Report Snapshot from an Access Report," for more information about report snapshots, and the following section, "Creating Dynamic Web Pages," for more information about data access pages.
Note Although data access pages may be dynamically linked to a data source, a report snapshot is always a static report, even when it is embedded in a data access page.
Creating Dynamic Web Pages
To create a dynamic Web page from Access, you can create a data access page. Data access pages combine the features of forms and reports so that you can display data to users and let users interact with data through Microsoft Internet Explorer version 5 or later. (You can also use other Web browsers to display data access pages, but users will not be able to work with the data directly.)
To create a data access page from VBA, use the CreateDataAccessPage method. To programmatically add controls to a data access page, use script or the Dynamic HTML (DHTML) object model to work with the HTML code directly. For more information about building and working with data access pages, see Chapter 5, "Working with Office Applications," and Chapter 12, "Using Web Technologies."