ACC2000: How to Set the Position of a Data Access Page on the Screen (234253)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q234253
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SUMMARY

This article describes how to set or change the location of a data access page on the screen.

MORE INFORMATION

The following steps show how the Top and Left (x,y) coordinates of a data access page or of Microsoft Internet Explorer can be set as the page opens, and after the page has already been opened.
  1. Open any Access 2000 database.
  2. Click Pages in the Database window, and then click New.
  3. Click Design View, and then click OK.
  4. Add a command button to the Section: Unbound section of the page, and then set the following properties of the button:
       ID: cmdSet
       FontWeight: bold
       InnerText: Set Position
       Left: 2.5in
       Top: 0.25in
    					
  5. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  6. On the View menu, point to Other Windows, and then click Script Outline.
  7. Expand the cmdSet node, and then double-click onclick.
  8. Type or paste the following script:
    <SCRIPT event=onclick for=cmdset language=vbscript>
    <!--
      'Define variables.
      Dim varTop
      dim varLeft
      
      'Initialize variables.
      varTop = InputBox("Enter the top coordinate", "TOP", 100)
      varLeft = InputBox("Enter the left coordinate", "LEFT", 300)
    
      'Set the IE window position.
      Window.MoveTo varTop, varLeft
     
    -->
    </SCRIPT>
    					
  9. Expand the window node, double-click onload, and then type or paste the following script:
    <SCRIPT LANGUAGE=vbscript FOR=window EVENT=onload>
     <!--
      Window.MoveTo 10, 10
     -->
    </SCRIPT>
    					
  10. Close the Microsoft Script Editor and, if you are prompted to save the changes, click Yes. Save the page as PosPage.htm in the C:\Inetpub\Wwwroot folder.
  11. Start Internet Explorer, and then type http://localhost/pospage.htm in the Address box. Note that the Internet Explorer window opens near the upper-left corner of the screen (Top position of 10 and Left position of 10).
  12. Click the Set Position button, and then click OK to accept the default Top value of 100, click OK again to accept the default Left value of 300, and note the new position of the Internet Explorer window.

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbDAP kbDAPScript kbhowto KB234253