Share via


Embedding an Existing Page in a Data Access Page

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

 

Meyyammai Subramanian
Microsoft Corporation

April 2001

Applies to:
   Microsoft® Access 2002

Summary: This article explains how you can embed a page in another data access page and synchronize the embedded page with the main page. (3 printed pages)

Contents

Introduction Embed a Page in Another Page

Introduction

Microsoft® Access does not provide a subpage control to embed a page in another page, but you can use an inline frame to display a page within another page in Page view or in Microsoft Internet Explorer. An inline frame provides the flexibility of viewing both pages at the same time and updating them.

The following illustration shows the Order Details page embedded into the Orders page. When you navigate through the records on the Orders page, the corresponding detail records automatically display on the Order Details page.

  Main page (Orders)

  Embedded page (Order Details)

Figure 1. A data access page within another page

Embed a Page in Another Page

  1. Create the main page with the controls you want. For example, create an Orders page that includes fields from the Orders table.

  2. Create a page that will display detail or other data that is related to the contents of the main page. For example, create an Order Details page that includes fields from the Order Details table.

  3. In the main page, add code to the Current event to create a server-side filter that will synchronize the two pages.

    The following is a sample Current event procedure.

    <SCRIPT LANGUAGE=vbscript FOR=MSODSC EVENT=Current(para)> 
    <!-- 
    Dim vLocation
    Dim vServerfilter 
    vLocation = _
        "http://<ServerName>/<FolderName>/OrderDetails.htm?serverfilter=" 
    vServerfilter = chr(34) & "Orderid=" & _
         para.section.htmlcontainer.all.orderid.value & chr(34) 
    vLocation = vLocation & vServerfilter
    window.frames("IFrm").location = vLocation
    --> 
    </SCRIPT>
    
  4. In the main page, add the following HTML code just before the closing <BODY> tag:

    <IFRAME ID=IFrm HEIGHT=45% WIDTH=80%>
    </IFRAME>
    
  5. View the main page in Page view or Internet Explorer.

**Note   **When you create Visual Basic® Scripting Edition (VBScript) blocks for Microsoft Office Data Source Control (MSODSC) events, you must add a parameter to the event name as follows:

<SCRIPT LANGUAGE=vbscript FOR=MSODSC EVENT=Current(oEventInfo)>

The oEventInfo parameter is used to return specific information about the event to the script. You must add this parameter, whether or not it will be used, because the script won't work without it.