PDA

View Full Version : Solved: Form Can't Control Itself



MWE
02-22-2006, 07:38 PM
This is not the form from hell, but it is its sibling

I am running Word2000. I have a very simple form and want to position it at a certain screen location. If the positioning statements are in the calling applicaion, e.g., ufrmPerComplete.Left = 100
ufrmPerComplete.Top = 500
ufrmPerComplete.Show vbModeless the form is position where I want.

But if the positioning statements are in the form's code module, e.g., Option Explicit
Private Sub UserForm_Activate()

Me.Top = 500
Me.Left = 100

End Sub the form is positioned at ( 0 , 0 )

If I remove the "vbmodeless", then the positioning in the form's code module works. Why does vbmodeless (which I use so the form will stay on the screen while the appl does other things) cause the above "problem?

Thanks

Jacob Hilderbrand
02-22-2006, 10:06 PM
Put the code in the Initialize event.


Option Explicit

Private Sub UserForm_Initialize()

Me.Top = 500
Me.Left = 100

End Sub

MWE
02-23-2006, 09:37 AM
Put the code in the Initialize event.


Option Explicit

Private Sub UserForm_Initialize()

Me.Top = 500
Me.Left = 100

End Sub

thanks

Jacob Hilderbrand
02-23-2006, 11:57 AM
You're Welcome :beerchug:

Take Care