473,509 Members | 4,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get and set form position

Hi all

Can anyone advise how to get the position of an open form and how to set the
position of an opening form within the access window.

I have: MA Access97 (because I do not have the funds to obtain a more recent
version nor the time to learn the new interface)
Form1 and form2. Both forms are an identical size because of the length of
the captions of the controls on the forms.

Form1 which shows the user a list of check boxes

Some of the check boxes have further options which are displayed as check
boxes on form2.

Code within the form1 check boxes looks to see whether further options exist
and if they do will open form2

I want form2 to display distance N away from the top line of form1 so the
user can see that both forms are open. Thus form2 left will be the same as
form1 left but form 2 top will be form1 Top - 15mm. I have found references
to .top and .left but these properties are not available.

Currently both forms are autocentrered so when form2 is opened it obscures
form1. This is confusing to the user who thinks form1 has closed.

Any suggestions gratefully received as my research so far has drawn a blank

Many thanks

Andrew Hall
Mar 17 '07 #1
3 55912
The actual properties to use are WindowTop, WindowLeft, WindowHeight,
Window Width.
Other properties you may need to consider are Form.Detail.Height and
Form.Width. These are seperate from the window properties and can be
different. The window size is not always the size of the form.

To move the form, use the DoCmd.MoveSize method. This allows you to
position the form relative to the Access window and to resize the form
if needed.

Note: The 0,0 (origin) point in Access is the topmost and leftmost
corner of the Access window BELOW the lowest menubar. The origin
relative to the actual screen can change depending on how many menus
are on screen.

Mar 17 '07 #2
On Sat, 17 Mar 2007 16:12:07 GMT, Andrew Hall wrote:
Hi all

Can anyone advise how to get the position of an open form and how to set the
position of an opening form within the access window.

I have: MA Access97 (because I do not have the funds to obtain a more recent
version nor the time to learn the new interface)
Form1 and form2. Both forms are an identical size because of the length of
the captions of the controls on the forms.

Form1 which shows the user a list of check boxes

Some of the check boxes have further options which are displayed as check
boxes on form2.

Code within the form1 check boxes looks to see whether further options exist
and if they do will open form2

I want form2 to display distance N away from the top line of form1 so the
user can see that both forms are open. Thus form2 left will be the same as
form1 left but form 2 top will be form1 Top - 15mm. I have found references
to .top and .left but these properties are not available.

Currently both forms are autocentrered so when form2 is opened it obscures
form1. This is confusing to the user who thinks form1 has closed.

Any suggestions gratefully received as my research so far has drawn a blank

Many thanks

Andrew Hall
1) Do not use the AutoCenter property of either form.

2) Look up the MoveSize method in VBA help.

Note: All measurements are in Twips (1440 per inch). You'll have to do
the math to convert inches to cm.

Set Forms1 to a specific position in the window (I'm using inches
measurements). For example, code the Form's Open Event:

DoCmd.MoveSize 3 *1440, 4 *1440

3 inches from the left edge of the screen, 4 inches down from the top
of the screen.

Set theForm2 position similarly to position it .6 inch below the
Form1. Code the Form2 Open Event:

DoCmd.MoveSize 3*1440, 4.6* 1440

Also 3 inches from the left edge of the screen, but 4.6 inches down
from the top of the screen.
Adjust the actual placement as required.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Mar 17 '07 #3
Thanks for the advise

A great help

I now have forms positioned all over the place

Andrew

"Andrew Hall" <an**********@virgin.netwrote in message
news:rr*****************@newsfe7-gui.ntli.net...
Hi all

Can anyone advise how to get the position of an open form and how to set
the
position of an opening form within the access window.

I have: MA Access97 (because I do not have the funds to obtain a more
recent
version nor the time to learn the new interface)
Form1 and form2. Both forms are an identical size because of the length of
the captions of the controls on the forms.

Form1 which shows the user a list of check boxes

Some of the check boxes have further options which are displayed as check
boxes on form2.

Code within the form1 check boxes looks to see whether further options
exist
and if they do will open form2

I want form2 to display distance N away from the top line of form1 so the
user can see that both forms are open. Thus form2 left will be the same as
form1 left but form 2 top will be form1 Top - 15mm. I have found
references
to .top and .left but these properties are not available.

Currently both forms are autocentrered so when form2 is opened it obscures
form1. This is confusing to the user who thinks form1 has closed.

Any suggestions gratefully received as my research so far has drawn a
blank
>
Many thanks

Andrew Hall


Mar 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
5891
by: dave | last post by:
Hello, I've got a site project that i've got to design a layout without resorting to tables. I want to use a table for tabular data not any formatting layout, primarily emphasis needs to be on...
0
2132
by: Steve | last post by:
Hi all Is there a way in which I can get the Form's position on the screen in pixels? I am having to position another form in relation to an MDI Child form, so I cannot use the Location...
7
3570
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
2423
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution...
3
1976
by: Andy | last post by:
Hi, I have a simple problem concerning the position of forms. My windows form application has a main form and three instances of a second form; BForm. It is not an MDI parent/child...
1
1823
by: Hamed | last post by:
Hello Two questions about positioning: When I run my MDI application developed by VS.NET 2003, the MDI window is opened in a new place and after some run again and again, it opens in a...
2
4483
by: Govert J. Knopper | last post by:
Here's my C# newbie question: How do I set the position of a modal form? This (correctly) positions top left of the form at the position of the main form: .... Form frmAbout = new About();...
1
2881
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are...
13
3577
by: Andrew Falanga | last post by:
HI, Just a warning, I'm a javascript neophyte. I'm writing a function to validate the contents of a form on a web page I'm developing. Since I'm a neophyte, this function is quite simple at...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7073
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.