[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set size and position of a form

Posted on 2009-12-23
26
Medium Priority
?
760 Views
Last Modified: 2013-11-28
I have spent two hours researching how to do this and still cannot get it to work.  I'm sure this is very simple.  All I want to do is set the size and position of a form in Access when the form opens.  I've tried all kinds of things I found posted, but can't get it to do anything other than open full size.  I appreciate any help you can offer.
0
Comment
Question by:ginsburg7
  • 9
  • 8
  • 7
24 Comments
 
LVL 75
ID: 26116796
Example:

Private Sub Form_Open(Cancel As Integer)
    Move 100, 200, 1440 * 3, 1440 * 5
End Sub

1440 twips/inch

Move Method
See AlsoApplies ToExampleSpecificsMoves the specified object to the coordinates specified by the argument values.

expression.Move(Left, Top, Width, Height)
expression    Required. An expression that returns one of the objects in the Applies To list.

Left   Required Variant. The screen position in twips for the left edge of the object relative to the left edge of the Microsoft Access window.

Top   Optional Variant. The screen position in twips for the top edge of the object relative to the top edge of the Microsoft Access window.

Width   Optional Variant. The desired width in twips of the object.

Height   Optional Variant. The desired height in twips of the object.


****  mx
0
 
LVL 75
ID: 26116798
Be sure you are not maximizing the form, and the from is set Border Style = Sizable.

mx
0
 

Author Comment

by:ginsburg7
ID: 26116834
That did not work, so here is what I did.  I suspect I am misapplying your suggestion:
Using Access 2007, I opened my form in Design view.  Only the Detail section shows.
I right-click and select Properties.
I change the Selection Type: Section to Form
I select the Event tab
I click in the On Open field, then on the elipse button
I select Code Builder
I paste in this:

Private Sub Form_Open(Cancel As Integer)
    Move 100, 200, 1440 * 3, 1440 * 5
End Sub

I click the save icon and exit out of Visual Basic
I close my Property Sheet window, save the form, close the form, reopen it and it is still full size.
My Border Style is set to Sizable.

I don't know if it is helpful to note, but I do not have the three size selection icons (maximize, minimize and mid-size) in the upper right corner of the form.  This is not by choice.
1
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75
ID: 26117262
ok ... Can you:  (NOTE:  If you have an A2007 ACCDB, please convert to A2003 MDB.)

1) Compact & Repair (*** to shrink the size),

2) Zip up the MDB (*** to further shrink the size)

3) Attach the file for upload here (using the 'Attach File function below) ... removing any sensitive data of course.

4**** And please give a clear explanation of exactly how to reproduce the problem or what you are trying to do.


mx
0
 

Author Comment

by:ginsburg7
ID: 26117313
I am working on the form named More Than 40 Hours Check.  I just want to specify a reasonable size.  If you solve my problem, please tell me what you did, as well.  I appreciate it very much.
Database1.zip
0
 

Author Comment

by:ginsburg7
ID: 26117325
I have attached the same database with the navigation pane visible.
Database1.zip
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26117456
Try the move method suggested by DatabaseMX, even using a button on the form.
To see the effect use ovelapping windows from access options-current datatbase
Set form to dialog.

I guess it will behave as required when used under runtime.
Try it and report back!
0
 
LVL 75
ID: 26117458
Well, it's working for me in A2003.  This must be some change / anomaly in A2007.  As we speak, I'm installing O2007 Ultimate on another laptop.   Go ahead and upload your A2007 version.

mx
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26117466
I meant Modal!
0
 

Author Comment

by:ginsburg7
ID: 26117472
I'm actually using it as a 2003 database.
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26117556
Then what about DatabaseMX's comment? "Well, it's working for me in A2003"
0
 

Author Comment

by:ginsburg7
ID: 26117567
Beats me.  It's not working for me in v2007.
0
 
LVL 75
ID: 26117569
Upload the A2007 version.
0
 

Author Comment

by:ginsburg7
ID: 26117577
I'm only using this as a 2003 version, but within 2007, so I have nothing else to upload.
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26117580
Correction: I think in 2007 it requires ovelapping windowsfor form's move method  to work.
0
 

Author Comment

by:ginsburg7
ID: 26117589
is that a property setting?  If not, please elaborate.
0
 
LVL 75
ID: 26117600
ok ... I will try to check the A2003 version within my A2007 environment.

mx
0
 
LVL 31

Accepted Solution

by:
hnasr earned 2000 total points
ID: 26117745
"is that a property setting? If not, please elaborate."

This is an option setting in access 2007.
Office button > Access Options >  current database > Overlapped Windows
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26119402
You are welcome.
If I was you, I could have split the points. DatabaseMX's comment is helpfull.
0
 

Author Comment

by:ginsburg7
ID: 26119512
I'm new to this.  Is there a way I can redo it?  I agree that DatabaseMX's comments were helpful, but not to me.  I had already done what he suggested and it didn't work.  Your advice made the difference.
0
 
LVL 31

Expert Comment

by:hnasr
ID: 26119647
Click the "! Request Attention button" to the bottom right of the question area.
0
 
LVL 75
ID: 26120032
no need.  hnasr solved the problem.

mx
0
 
LVL 75
ID: 26121759
no need.  hnasr solved the problem. no split necessary.

mx
0
 

Author Closing Comment

by:ginsburg7
ID: 31669669
hnasr, thank you!  That was perfect.  And how stupid is that option!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

834 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