Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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).

↑ Back to the top


Summary

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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB234253, kbdapscript, kbdap, kbhowto

↑ Back to the top

Article Info
Article ID : 234253
Revision : 2
Created on : 6/24/2004
Published on : 6/24/2004
Exists online : False
Views : 294