473,786 Members | 2,866 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form display position

Hi

I have a small pop non-dialog form that I need to appear towards the right
side of the screen. Is there a way to achieve this?

Regards
Nov 13 '05 #1
4 9506
In the form's properties under the Format tab, set the autocenter and
autosize properties to No. Click on the Views button on the toolbar and
select form view. Grab the titlebar of the form and drag the form to where
you want it to open on the screen. Close the form. At this point you must
have done something previously to cause Access to ask if you want to save
the changes to the form. If Access does not ask, the position does not get
saved. Assuming you are asked to save, click Yes.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"John" <Jo**@nospam.in fovis.co.uk> wrote in message
news:41******** **************@ news-text.dial.pipex .com...
Hi

I have a small pop non-dialog form that I need to appear towards the right
side of the screen. Is there a way to achieve this?

Regards

Nov 13 '05 #2
A better way is on the OnOpen event, use the docmd.movesize command (4
options)
you can specify how far from the top, right, hight and width you want the
window to appear.

It does its measurements in twips (1440 twips = 1 inch)

docmd.movesize 1440, 1440 (you dont have to specify the size if you dont
want) this command just said that the top-left corner of the screen is 1
inch in from the left and 1 inch down from the top.
HTH, Paul

"PC Datasheet" <no****@nospam. spam> wrote in message
news:EE******** ***********@new sread3.news.atl .earthlink.net. ..
In the form's properties under the Format tab, set the autocenter and
autosize properties to No. Click on the Views button on the toolbar and
select form view. Grab the titlebar of the form and drag the form to where
you want it to open on the screen. Close the form. At this point you must
have done something previously to cause Access to ask if you want to save
the changes to the form. If Access does not ask, the position does not get
saved. Assuming you are asked to save, click Yes.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"John" <Jo**@nospam.in fovis.co.uk> wrote in message
news:41******** **************@ news-text.dial.pipex .com...
Hi

I have a small pop non-dialog form that I need to appear towards the
right
side of the screen. Is there a way to achieve this?

Regards


Nov 13 '05 #3
"John" <Jo**@nospam.in fovis.co.uk> wrote in
news:41******** **************@ news-text.dial.pipex .com:
Hi

I have a small pop non-dialog form that I need to appear towards the
right side of the screen. Is there a way to achieve this?

Regards


You might try putting this code in a standard module:

***************
Option Explicit

Private Declare Function GetSystemMetric s Lib "user32" _
(ByVal nIndex As Long) As Long

Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, lpRect As Rectangle) As Long

Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long

Private Const HWND_TOP As Long = 0
Private Const SM_CYVTHUMB As Long = 9
Private Const SWP_NOZORDER As Long = &H4

Private Type Dimensions
Width As Long
Height As Long
End Type

Private Type Rectangle
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Public Sub PlaceFormRight( ByRef Form As Form)

Dim AccessRectangle As Rectangle
Dim AccessWindow As Long

Dim FormDimensions As Dimensions
Dim FormRectangle As Rectangle
Dim FormWindow As Long

Dim NewLeft As Long

AccessWindow = hWndAccessApp
GetWindowRect AccessWindow, AccessRectangle

FormWindow = Form.hwnd
GetWindowRect FormWindow, FormRectangle
With FormRectangle
FormDimensions. Height = .Bottom - .Top
FormDimensions. Width = .Right - .Left
End With

NewLeft = AccessRectangle .Right - FormDimensions. Width -
GetSystemMetric s(SM_CYVTHUMB)

If NewLeft > AccessRectangle .Left Then _
SetWindowPos FormWindow, _
HWND_TOP, _
AccessRectangle .Right - FormDimensions. Width - _
GetSystemMetric s(SM_CYVTHUMB), _
0, _
FormDimensions. Width, _
FormDimensions. Height, _
SWP_NOZORDER

End Sub
*******

and calling ths sub in the form's module as

*************** ********
Private Sub Form_Activate()
PlaceFormRight Me
End Sub
*******

.... and you might experiment a bit with the system metrics call to get
exactly the result you want.

--
Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.
Nov 13 '05 #4
Actually, it's not a better way unless for some reasom you want a precise
position. Every bit of code increases the load time of an application and
also any code in the form's Open event increases the load time every time
the form is opened.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"Paul" <pz****@rogers. com> wrote in message
news:Yv******** ************@ro gers.com...
A better way is on the OnOpen event, use the docmd.movesize command (4
options)
you can specify how far from the top, right, hight and width you want the
window to appear.

It does its measurements in twips (1440 twips = 1 inch)

docmd.movesize 1440, 1440 (you dont have to specify the size if you dont
want) this command just said that the top-left corner of the screen is 1
inch in from the left and 1 inch down from the top.
HTH, Paul

"PC Datasheet" <no****@nospam. spam> wrote in message
news:EE******** ***********@new sread3.news.atl .earthlink.net. ..
In the form's properties under the Format tab, set the autocenter and
autosize properties to No. Click on the Views button on the toolbar and
select form view. Grab the titlebar of the form and drag the form to where you want it to open on the screen. Close the form. At this point you must have done something previously to cause Access to ask if you want to save the changes to the form. If Access does not ask, the position does not get saved. Assuming you are asked to save, click Yes.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com
"John" <Jo**@nospam.in fovis.co.uk> wrote in message
news:41******** **************@ news-text.dial.pipex .com...
Hi

I have a small pop non-dialog form that I need to appear towards the
right
side of the screen. Is there a way to achieve this?

Regards



Nov 13 '05 #5

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....
1
2075
by: Paul THompson | last post by:
I am using IE to hide sections of a form. When I display the first section (name='ea'), the form widgets are not clickable in IE nor do they accept focus. When I display the 3rd section (name='ec'), the items in all sections become clickable/accept focus. Has anyone ever seen anything like this? There are no problems at all in NN/Firefox/Mozilla. Here is some of the code - there is rather a lot, so I just display some of it:
1
2876
by: Alex Wisnoski | last post by:
Access 97SR2-I am trying to create a Job Position data entry form based on a table. The form has 15 fields on it. I want to use a combo box to look in the table and see if the position number already exists. If the position exists, then pull up that record and display the information on the form. If the position doesn't exist, inform the user and ask if they want to add it. If they elect to add it, then have a new record to add it in...
1
2416
by: kll | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data of the selected row in textboxes on dialog that execute by the user press a button. The following code works if I do not sort the datagrid before I press the button to bring up the dialog. It is when I sort it the datagrid I have the issue ...
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?
18
2988
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead. If you do have any ideas I would really like to hear them. Thanks Colin - 0 - 0 - 0 - I want a glorified popup/context menu on a button that shows only when
4
2455
by: Tomasz Bak | last post by:
Hello, I have a simple problem: mark a list of defects on an image. I think the best way to do it is to select a single deffect, then take two coordinates of coursor form an image on a web page (first when user press the button, and the second when he releases it). Those two points are going to be send to the web application (i.e. with AJAX) and saved in a database.
1
3466
by: grabit | last post by:
Hi Peoples i have a search page with a form field "subject" on my results page i have a paging routine . the first page lists its 10 records no trouble but when i click the "next" link i get a error telling me "subject is not defined in form" How can i overcome this please. I will post the page down to the end of the paging routine coz its not very long anyway. <cfquery name="searchResults" datasource="#dsn#"> SELECT threadID, posttype,...
3
55996
by: Andrew Hall | last post by:
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.
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...
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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...
1
10110
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
8989
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
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
5397
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...
1
4066
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
3669
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.