By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Setting the window size

P: n/a

Dear All,

How do I set the size of the window that is showing the database forms?

can't find any helps on it.
John Fox
Apr 19 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
GH
On Apr 19, 6:33 am, John Fox <altab...@bham.ac.ukwrote:
Dear All,

How do I set the size of the window that is showing the database forms?

can't find any helps on it.

John Fox
Are you talking about at design time? All you have to do is make sure
the window is not maximized so you can view its normal size, then
click and drag the edges of the window to resize. If you save the
form after changing the size, this will stick. If the form border
style is set to Sizable, the window can also be resized by clicking
and dragging during runtime, but this change will not be stored the
next time the window opens. If this is not what you are asking about,
please provide more detail as to what you are trying to accomplish.

- GH

Apr 19 '07 #2

P: n/a
Dear GH,

It's about the window size and shape at run time. I want to have a set
size for the window.
Have tried all the design time settings but they don't seem to
make any difference.
The borders of the window can always be moved.
John
On Apr 19, 6:33 am, John Fox <altab...@bham.ac.ukwrote:
>Dear All,

How do I set the size of the window that is showing the database forms?

can't find any helps on it.

John Fox

Are you talking about at design time? All you have to do is make sure
the window is not maximized so you can view its normal size, then
click and drag the edges of the window to resize. If you save the
form after changing the size, this will stick. If the form border
style is set to Sizable, the window can also be resized by clicking
and dragging during runtime, but this change will not be stored the
next time the window opens. If this is not what you are asking about,
please provide more detail as to what you are trying to accomplish.

- GH
Apr 19 '07 #3

P: n/a
GH
On Apr 19, 11:15 am, John Fox <altab...@bham.ac.ukwrote:
Dear GH,

It's about the window size and shape at run time. I want to have a set
size for the window.
Have tried all the design time settings but they don't seem to
make any difference.
The borders of the window can always be moved.

John
If you set your window size correctly at design time then change the
border type to any choice other than Sizable and save the form, your
settings will stick and the user will not be able to change your
settings at runtime. This is the only way to set the window size,
because once you hit runtime control of the window is given to the end
user not the program. All you can do is try to limit what the user
can do at runtime.

- GH

Apr 19 '07 #4

P: n/a
You can also set your OnOpen Event to
DoCmd.MoveSize (# * 1440), (# * 1440), (# * 1440), (# * 1440)

# = dimension of the size and position of the window.

GH wrote:
>Dear GH,
[quoted text clipped - 5 lines]
>>
John

If you set your window size correctly at design time then change the
border type to any choice other than Sizable and save the form, your
settings will stick and the user will not be able to change your
settings at runtime. This is the only way to set the window size,
because once you hit runtime control of the window is given to the end
user not the program. All you can do is try to limit what the user
can do at runtime.

- GH
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200704/1

Apr 19 '07 #5

P: n/a
Here's what I use. Paste the following code into a standard module, then
type:
SizeAccess 640, 480
into the immediate window.

HTH

''''''CODE START''''''
Private Type Rect
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type
'
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, r As Rect) As Long
Private Declare Function IsZoomed Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function MoveWindow Lib "user32" _
(ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, _
ByVal dx As Long, ByVal dy As Long, ByVal fRepaint As Long) As Long
Private Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Sub SizeAccess(ByVal dx As Long, ByVal dy As Long)
'Set size of Access and center on Desktop

Const SW_RESTORE As Long = 9
Dim h As Long
Dim r As Rect
'
On Error Resume Next
'
h = Application.hWndAccessApp
'If maximised, restore
If (IsZoomed(h)) Then ShowWindow h, SW_RESTORE
'
'Get available Desktop size
GetWindowRect GetDesktopWindow(), r
If ((r.x2 - r.x1) - dx) < 0 Or ((r.y2 - r.y1) - dy) < 0 Then
'Desktop smaller than requested size
'so size to Desktop
MoveWindow h, r.x1, r.y1, r.x2, r.y2, True
Else
'Adjust to requested size and center
MoveWindow h, _
r.x1 + ((r.x2 - r.x1) - dx) \ 2, _
r.y1 + ((r.y2 - r.y1) - dy) \ 2, _
dx, dy, True
End If

End Sub
''''''CODE END''''''

"John Fox" <al******@bham.ac.ukwrote in message
news:f0**********@redhat2.bham.ac.uk...
>
Dear All,

How do I set the size of the window that is showing the database forms?

can't find any helps on it.
John Fox

Apr 19 '07 #6

P: n/a
Thanks for the info, I seem to be able to set the size of the form
but not the window that it's in.
John Fox
GH wrote:
On Apr 19, 11:15 am, John Fox <altab...@bham.ac.ukwrote:
>Dear GH,

It's about the window size and shape at run time. I want to have a set
size for the window.
Have tried all the design time settings but they don't seem to
make any difference.
The borders of the window can always be moved.

John

If you set your window size correctly at design time then change the
border type to any choice other than Sizable and save the form, your
settings will stick and the user will not be able to change your
settings at runtime. This is the only way to set the window size,
because once you hit runtime control of the window is given to the end
user not the program. All you can do is try to limit what the user
can do at runtime.

- GH
Apr 19 '07 #7

P: n/a

I must have got something which is overriding this kind of command.
Have tried the DoCmd.MoveSize command and the window stays the same
position and size.

I'm using Access 2003, is this the problem?
Any ideas as to what is switching these commands off?

Putting in break points has proved that the routines are being activated.
John Fox
tobesurveyor via AccessMonster.com wrote:
You can also set your OnOpen Event to
DoCmd.MoveSize (# * 1440), (# * 1440), (# * 1440), (# * 1440)

# = dimension of the size and position of the window.

GH wrote:
>>Dear GH,
[quoted text clipped - 5 lines]
>>John
If you set your window size correctly at design time then change the
border type to any choice other than Sizable and save the form, your
settings will stick and the user will not be able to change your
settings at runtime. This is the only way to set the window size,
because once you hit runtime control of the window is given to the end
user not the program. All you can do is try to limit what the user
can do at runtime.

- GH
Apr 21 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.