?
Solved

Determine screen coordinate position of upper left corner of window

Posted on 2007-11-15
8
Medium Priority
?
1,099 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

752 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