?
Solved

Determine screen coordinate position of upper left corner of window

Posted on 2007-11-15
8
Medium Priority
?
1,103 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
 

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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

830 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