?
Solved

Proble with form size

Posted on 2008-11-11
5
Medium Priority
?
1,186 Views
Last Modified: 2013-11-28
Hi
In my 2007 database, i have a main form which call other forms, all of them works fine, but from time to time when i call a form, the forms open really small that i can eve resize it, i really do not know why, i play with the properties, like Modal, Auto Size, border stile, Popup, etc. But they seem to work and them happens again.
I change the way i open the form(vba/ macro), but it's still happening from tiem to time.
Some time if i open the form directly without the min form sometimes hapens, sometimes doesn't.

Any idea what could be causing this.

Best regards
Robert
0
Comment
Question by:titorober23
5 Comments
 
LVL 14

Accepted Solution

by:
ldunscombe earned 1000 total points
ID: 22935903
Not sure if it's what you are after but but a trick that I use quite often is to set the forms size and position in the OnActivate event of my forms. That way every time a form becomes active it is displayed how I intended.

eg

DoCmd.Maximise
DoCmd.Minimise
or
DoCmd.MoveSize([Right],[Down],[Left],[Right])

Leigh
0
 

Author Comment

by:titorober23
ID: 22935914
how do i specified a specific size and position?
because it seems that doe snot matter what i specified in the properties, bcause any way it changes from time to time.
0
 
LVL 14

Expert Comment

by:ldunscombe
ID: 22936450
You don't do it in the property sheet of the forms you do it via code in the OnActivate event, that way it is set automatically every time the form is activated.

Leigh
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 22939659
Open the form and size it how it should be.
Save the mdb.
View the form in design mode.
Access the LOAD event.
Open the Immediate window and type:
Print appliction.forms("yourformname").insideHeight

This will show you the InsideHeight value to use.
In the LOAD event type:
Application.forms("YourFormName").insideHeight = xxxx   (xxx being the value from the immediate window).
Repeat for InsideWidth

This forces the form size always.

Scott C
0
 
LVL 7

Expert Comment

by:Romolo
ID: 22941356
I too have experienced this... it seems to be a Microsoft Feature :)

What you need to do is place a button on the form to find out exact sizes and put the following code within that button

MsgBox CONTROLORFORMNAME.Left & " " & CONTROLORFORMNAME.Top & " " & CONTROLORFORMNAME.Width & " " & CONTROLORFORMNAME.Height

This will give you a list of numbers of its current position (This is providing you can load form correctly.. run it in Access2003 :)

Then on open event of the form...

place the following with the values you got from msgbox

CONTROLORFORMNAME.Move 4648, 1820, 1000, 300

This will guarantee its in the right place everytime it loads

Its a real pain when ACCESS2007 does this... tbh... I develop in Access2003 then upgrade

BECAUSE Access 2007 does not have enough to warratn development in vs troublesome less userfriendly interface.

Still use Access for full system development or as Pilot system

R
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

829 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