weird problem: form will not maximize

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • insomniux

    #1

    weird problem: form will not maximize

    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,o nActivate. What else can I try to get
    this form open maximized?

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

    Sub IdleTimeDetecte d(ExpiredMinute s)
    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

  • jasmith@bigriver.net

    #2
    Re: weird problem: form will not maximize

    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:[color=blue]
    > 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,o nActivate. What else can I try to get
    > this form open maximized?
    >
    > The code I use to close and reopen the form is:
    >
    > Sub IdleTimeDetecte d(ExpiredMinute s)
    > 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[/color]

    Comment

    • insomniux

      #3
      Re: weird problem: form will not maximize

      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!

      Comment

      Working...