473,785 Members | 2,209 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 55994
The actual properties to use are WindowTop, WindowLeft, WindowHeight,
Window Width.
Other properties you may need to consider are Form.Detail.Hei ght 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**********@v irgin.netwrote in message
news:rr******** *********@newsf e7-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
5915
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 using css to place form elements. My method thus far has been to use a table, for several reasons i don't want to resort to this, i'd rather place the elements with css and get a standards compliant site. I am uncertain as to how to accomplish this....
0
2176
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 property, because the MDI Child is usually 0,0 (Top left in the parent container) so if I position my other form in that location it goes to the top left of the entire screen. I have tried using the overloaded ShowDialog method to make the MDI Child form...
7
3615
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> </head> <style type="text/css">
6
2434
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 options and DPI options. However when I tried to run it in a dell P3 desktop, labels and textboxes overlapped each other and they were in table area too. Any suggestions? Do I have to put all controls in table cells?
3
1991
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 application and I've set the StartPosition property for both forms to be Manual. In the New method of the main form I create the 3 BForms and try to position them below the main form (with the left sides aligned) using
1
1959
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 position that some borders of MDI form goes out of the desktop. The WindowState of MDI form is in Normal state.
2
4504
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(); frmAbout.Show(); frmAbout.Left = this.Left;
1
2905
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 further to the right of the form than the form's default width - which may take up the entire screen for some users). The form contains panels which will contain either textboxes or datagridviews. The button is located on the menustrip towards...
13
3612
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 this time (in fact, I don't even know if it totally works, I'm still debugging). However, the first problem is that when an error is encountered, I get my alert box, I press ok and then the form is submitted and the new data is entered into the...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6742
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
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 we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.