Set size and position of a form

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.
ginsburg7Asked:
Who is Participating?
 
hnasrCommented:
"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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Be sure you are not maximizing the form, and the from is set Border Style = Sizable.

mx
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ginsburg7Author Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
 
ginsburg7Author Commented:
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
 
ginsburg7Author Commented:
I have attached the same database with the navigation pane visible.
Database1.zip
0
 
hnasrCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
 
hnasrCommented:
I meant Modal!
0
 
ginsburg7Author Commented:
I'm actually using it as a 2003 database.
0
 
hnasrCommented:
Then what about DatabaseMX's comment? "Well, it's working for me in A2003"
0
 
ginsburg7Author Commented:
Beats me.  It's not working for me in v2007.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Upload the A2007 version.
0
 
ginsburg7Author Commented:
I'm only using this as a 2003 version, but within 2007, so I have nothing else to upload.
0
 
hnasrCommented:
Correction: I think in 2007 it requires ovelapping windowsfor form's move method  to work.
0
 
ginsburg7Author Commented:
is that a property setting?  If not, please elaborate.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
ok ... I will try to check the A2003 version within my A2007 environment.

mx
0
 
hnasrCommented:
You are welcome.
If I was you, I could have split the points. DatabaseMX's comment is helpfull.
0
 
ginsburg7Author Commented:
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
 
hnasrCommented:
Click the "! Request Attention button" to the bottom right of the question area.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
no need.  hnasr solved the problem.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
no need.  hnasr solved the problem. no split necessary.

mx
0
 
ginsburg7Author Commented:
hnasr, thank you!  That was perfect.  And how stupid is that option!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.