Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

docmd.movesize on popup forms

Status
Not open for further replies.

AJLoehr

Programmer
Oct 3, 2008
26
US
I have 1 form (frmMAIN) set to Popup and Modal. On it, I have a button that opens another form (frmReports) also set to Popup and Modal.

frmMAIN has the docmd.movesize var1, var2, 4800, 1400
frmMAIN also has a timer running on it and basically shows time on a label format(now(),"HH:NN:SS")

frmREPORTS does not use any code.

When I click the button on frmMAIN to open frmREPORTS, frmREPORTS opens to the same size and position that frmMAIN is in, even though frmREPORTS is naturally a different size and set to AutoResize and AutoCenter.

frmREPORTS also opens correctly if opened on it's own, not thru the frmMAIN code.

Why? I know it has something to do with the timer function on frmMAIN, but how?

My code on the timer is as follows:

Code:
    Select Case TIMElbl.Visible
        Case True
            TIMElbl.Caption = Format(Now(), "HH:NN:SS")
        Case False
            'do nothing
    End Select
    Select Case BUTTONSS.Value
        Case 0
            'do nothing
        Case Else
            BUTTONSS.Value = BUTTONSS.Value - 1
    End Select
    If BUTTONSS.Value = 1 Then
        Call tabcolor(BUTTONVIEW.Value)
        With Forms!frmMAIN
            DoCmd.MoveSize x1.value, x2.value, 4800, 1400
        End With
    End If

I threw in the With forms!frmMAIN to try to force the docmd.movesize to only affect that frmMAIN form, but it didn't work.

Any help would be greatly appreciated.
 
Nevermind...

On the frmMAIN, on the button that opens the frmREPORTS I had a couple lines of code. One pointed to something that I didn't think affected anything. But there was another line of docmd.movesize code and when I added the with forms!frmREPORTS it worked fine.

Can I give myself a Star?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top