Open form - force full size

B

BlueWolvering

Hello,
I am using Access 2003 on Windows XP machines.

I have a button that opens a form. When I put the database (.mdb) file on
my coworker's machine, she clicks the button and the form is NOT full size,
i.e. there are scroll bars and she has to manually resize the window every
time. She might open this form several tens of times in a day so this is
unacceptable.

Can I do something about this? on form load? ON click button?

Let me know, thanks.
 
B

BlueWolvering

Won't that "maximizie" maximize it? I don't really want to force it to the
whole screen, but I want to force it to say, 100% zoom if that makes any
sense. so if the form is 3"x5" and it curently opens to 2"x4", instead of
your suggestion of maximizing the form (to call it 12"x13") I'd like to open
it to its designed size of about 3"x5".

Maximize might be a bit better but Not exactly what I'm looking for.

Thank you for your help.
 
K

Klatuu

In the Form's Activate event:

Docmd.Restore

This will cause it to assume the size at which it was last saved.
Use the Activate event because if you move to a different form, it may not
retain it's size. the Activate event will fire each time the form becomes
the active form.
 
B

BlueWolvering

This is the best I have found on my own.

If you go into design mode, and get the form's properties, there is a FORMAT
property called "AutoResize" which is by default set to you YES.

If you set this to NO, whatever size the window was the last time you saved
the form, is how large it will open up.

So if you open up a window to 5x5 and click on the diskette to save, the
next time you open the form it will be 5x5.

I'd still prefer the code opening the form to do it, because my user could
hit save and mess this up, but this works OK.

Thanks guys
 
K

Klatuu

That is not exactly what AutoResize does:
Returns or sets a Boolean indicating whether a Form window opens
automatically sized to display complete records. Read/write.

If you don't want any changes to the form when you close it, use

Docmd.Close acForm, Me.Name, acSaveNo

The acSaveNo applies to form changes, not to any data changes.
 
B

BlueWolverine

That's not how MS Access help describes auto resize. I searched within
access (or possibly vba acces) and it returned autoresize with basically the
idea I gave you.

Let me know if I am misinterpreting the help page.
 
K

Klatuu

The text I posted is from VBA Help on AutoResize.
Here is the entire topic:

AutoResize Property
See AlsoApplies ToExampleSpecificsReturns or sets a Boolean indicating
whether a Form window opens automatically sized to display complete records.
Read/write.

expression.AutoResize
expression Required. An expression that returns one of the objects in the
Applies To list.

Setting
The AutoResize property uses the following settings.

Setting Visual Basic Description
Yes True (Default) The Form window is automatically sized to display a
complete record.
No False When opened, the Form window has the last saved size. To save a
Form window's size, open the form, size the window, save the form by clicking
Save on the File menu, and close the form. When you next open the form, it
will be the saved window size.


You can set this property by using the form's property sheet, a macro, or
Visual Basic.

This property can be set only in Design view.

Remarks
The Form window resizes only if opened in Form view. If you open the form
first in Design view or Datasheet view and then change to Form view, the Form
window won't resize.

If you make any changes in Design view to a form whose AutoResize property
is set to No and whose AutoCenter property is set to Yes, switch to Form view
before saving the form. If you don't, Microsoft Access clips the form on the
right and bottom edges the next time you open the form.

If the AutoCenter property is set to No, a Form window opens with its
upper-left corner in the same location as when it was closed.
 
B

BlueWolverine

Klatuu-

Are we arguing functionally the same point? I can't tell what's going on...

I think my fix works for now, but it sounds like you are trying to get into
what is technically happening in the background........

Anyway, I don't mean to split hairs or get into an argument.

I appreciate the help.

Thanks,
 
K

Klatuu

No, I am not trying to argue or split hairs. I was under the impression you
misunderstood what Auto Resize does. I believe you said you couldn't find
information on it, so I was posting the help topic to help you understand it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top