Solved

Determine screen coordinate position of upper left corner of window

Posted on 2007-11-15
8
1,092 Views
Last Modified: 2012-08-14
Is there a method using VB to determine the position on an Access(2002-2003) form at the upper left corner of the form window?  I need this information for cases where the window is sized smaller than the size of the form (scroll bars are present) and the user has adjusted the vertical/horizontal scrollbar position.

Any method for determing the area of the form contained within the current window would be helpful.

Thanks,

Craig Harrington
0
Comment
Question by:cnharrington
  • 4
  • 4
8 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 20292045
0
 

Author Comment

by:cnharrington
ID: 20292772
Hello Capricon1

Thanks for the reply.  I reviewed the links that you provided and it seems they solve a problem of rescaling a form and its controls to fit a new window size.  My problem is somewhat different in that I am trying to position certain form objects based on a knowing what portion of the form is being viewed in the current window.

I have attached a screenshot to help clarify my problem.
https://filedb.experts-exchange.com/incoming/ee-stuff/5635-Example.JPG

Thanks for your help

Craig Harrington

0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 20292903
i don't exactly understand what you want to do, but to position a form when it opens you can use this

docmd.MoveSize right,down,width,height  

values in twips
1 inch=1440 twips

also see this link

http://support.microsoft.com/?kbid=210141
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 20292922
you can start with
docmd.movesize 0,0

the right and down values determines the position of the upper left corner of the form with respect to the  access window
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:cnharrington
ID: 20293240
I understand how to locate/move the control.  But before I can position a control I must understand where my view is positioned on the form.  I need to determine where the user has "scrolled" within the current window to view a certain portion of the form (similar to my example screen shot).

I was hoping to be able to locate the current view by understanding the relative location of this view with respect to the form.  Alternatively, if I could understand to current scroll position then I could then I could compute the form position.

Does this explain my issue better?

Thanks for the help.

Craig
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 20293779
sorry, but ....

from the link i posted above

MORE INFORMATION
In Microsoft Access, you can use the WindowWidth and WindowHeight form properties to determine the current width and height of the window that a form is contained in.
********* However, there are no properties to determine the window's right and down measurements (these measurements are commonly used in the MoveSize macro action to position a form window). ********

The right and down measurements, along with the width and height, are useful if you want to position a form side-by-side with another form. The following examples show you how to create and use the GetFormDimensions Sub procedure to get these measurements and to use them to position a form to the right of, and then below, another form by using the MoveSize macro action.

0
 

Author Comment

by:cnharrington
ID: 20293955
I was hoping to find a simplier VBA based method rather than direct API calls but if that's the only way.

Thanks for your efforts.

Craig
0
 

Author Comment

by:cnharrington
ID: 20294540
I was able to drop-in the MS Support code quite easily.  It works fine.

Thanks again.

Craig
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now