Maximize the form on the screen

E

ericb

I would like a form to open up and to take up the hole screen, or to maximize
automatically. It is presently opening with the PopUp property set to yes.

I put in the on load event these lines :
me.setfocus
docmd.maximize

but it does not do it.

I still have to click the maximize button on the form to get it to take up
the hole screen.

What else should I do ?

Thank you for the tip.
 
J

Jeanette Cunningham

Put this line of code

DoCmd.Maximize


on the form's activate event.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

Dirk Goldgar

ericb said:
I would like a form to open up and to take up the hole screen, or to
maximize
automatically. It is presently opening with the PopUp property set to yes.

I put in the on load event these lines :
me.setfocus
docmd.maximize

but it does not do it.

I still have to click the maximize button on the form to get it to take up
the hole screen.

What else should I do ?


That code in the Load event works for me in a test popup form, in both
Access 2003 and Access 2007. My guess is that something else is going on,
but I don't know what it might be. Have you verified that the code in the
event procedure is actually being executed? If you set a breakpoint in the
procedure, is it reached?
 
D

Dirk Goldgar

Jeanette Cunningham said:
Put this line of code

DoCmd.Maximize


on the form's activate event.


So far as I can tell, the Activate event doesn't fire for PopUp forms.
 
E

ericb

In the on load event i put msgbox "load".

The odd thing is i get the message when i click the close button of the form.
I don't get this one, a message in the on load event appears when i close
the form !!!

So i removed those lines in the on load event and put them just before the
last one in the on open event. The last line being :

DoCmd.ShowToolbar "Ribbon", acToolbarNo

and everything works fine. God knows why !

I think I am making a phobia on the ms button. That last line clears
everything and then my form will cover all of the rest.

I will remove the min max options so the user will stay no matter what in my
application. I hope. They will have a logout button.

How can i replace the microsoft form icon that appears on an open form by
mine ?
 
J

Jeanette Cunningham

Ah, yes I should have remembered that.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

Dirk Goldgar

ericb said:
In the on load event i put msgbox "load".

The odd thing is i get the message when i click the close button of the
form.
I don't get this one, a message in the on load event appears when i close
the form !!!

Very odd.
So i removed those lines in the on load event and put them just before the
last one in the on open event. The last line being :

DoCmd.ShowToolbar "Ribbon", acToolbarNo

and everything works fine. God knows why !

I wonder if the call to ShowToolbar is interfering in some way. Have you
tested to see what happens if you comment that out?
How can i replace the microsoft form icon that appears on an open form by
mine ?

For the whole database, there's a setting in the Current Database options:

http://office.microsoft.com/en-us/access/HA102270581033.aspx

If you want to have a different icon for each form, I don't know at the
moment.
 

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