By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,467 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,467 IT Pros & Developers. It's quick & easy.

weird problem: form will not maximize

P: n/a
Hi,
I have an Access 2000 database with one main form in which all subforms
are embedded. In this form I have a timer which closes the form,
detaches the linked (ODBC) tables and reopens the same form with a
login dialog (initiated in onOpen).

When I open the application the form maximizes (as it should). But when
the code reopens the form, the form is not maximized. I have
DoCmd.Maximize in onOpen,onLoad,onActivate. What else can I try to get
this form open maximized?

The code I use to close and reopen the form is:

Sub IdleTimeDetected(ExpiredMinutes)
Dim frmName As String
frmName = "OpenForm"
DoCmd.Close acForm, frmName, acSaveYes
DisconnectTable ("") 'this detaches the linked tables
DoCmd.Maximize
DoCmd.OpenForm frmName 'here the form opens non-maximized
End Sub

Thanks for your help

Mar 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you take a closer look at your last two lines of code, you are
trying to maximize the form before opening it. Reverse the order and
you should be fine.

Jason

insomniux wrote:
Hi,
I have an Access 2000 database with one main form in which all subforms
are embedded. In this form I have a timer which closes the form,
detaches the linked (ODBC) tables and reopens the same form with a
login dialog (initiated in onOpen).

When I open the application the form maximizes (as it should). But when
the code reopens the form, the form is not maximized. I have
DoCmd.Maximize in onOpen,onLoad,onActivate. What else can I try to get
this form open maximized?

The code I use to close and reopen the form is:

Sub IdleTimeDetected(ExpiredMinutes)
Dim frmName As String
frmName = "OpenForm"
DoCmd.Close acForm, frmName, acSaveYes
DisconnectTable ("") 'this detaches the linked tables
DoCmd.Maximize
DoCmd.OpenForm frmName 'here the form opens non-maximized
End Sub

Thanks for your help


Mar 23 '06 #2

P: n/a
Mmm....
You're right. But still it is odd. The form does not listen to the
maximize commands in the onOpen event.
My consideration to put the command before the DoCmd.OpenForm command
is that usually, if the database window is maximized, the forms open
maximized as well.
Anyway. Thanks for your tip. It solved my problem!

Mar 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.