Resizing a Form in VBA

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

I am trying to resize a form that I created. I was able to expand the form
from 216.75 to 344 but when I try to go back to 216.75, the form is still
showing the lower parts that I am trying to hide. And when I try to move the
form, I get the trailing shadow effect. Here the the code I was using:
Private Sub cmdWeekly_Click()

If Me.cmdWeekly.Caption = "More Options >>" Then
Me.Height = 344
Me.cmdWeekly.Caption = "More Options <<"
Me.frmReport.Enabled = False
Me.optBoth.Enabled = False
Me.optToday.Enabled = False
Me.optTomorrow.Enabled = False
Me.cmdBuildReport.Enabled = False
Else
Me.Height = 216.75
Me.cmdWeekly.Caption = "More Options >>"
Me.frmReport.Enabled = True
Me.optBoth.Enabled = True
Me.optToday.Enabled = True
Me.optTomorrow.Enabled = True
End If
Me.Repaint
End Sub

Any ideas?

Thanks
 
I figured it out. Just needed to add "Application.ScreenUpdating = True"
somewhere in the coding.
 
Back
Top