I have a very small form, which when it opens, I'd like to position precisely in relation to the main form. Is there some way of using properties, or VBA, to set screen coordinates or the like, to do so ? Thanks.
Adjust the number of TWIPS as needed. I used 200 and minus to put it above and to the left of the form and you would use a positive number to move to the right and/or down.
I forgot to mention that you can use similar code from the main form's ON RESIZE event where you can refer to the small form:
Code:
Private Sub Form_Resize()
If CurrentProject.AllForms("SmallFormNameHere").IsLoaded Then
Forms!SmallFormNameHere.Top = Me.Top - 200
Forms!SmallFormNameHere.Left = Me.Left - 200
End If
And that way whenever you move the main form, the small form will come along for the ride. I used the IsLoaded part to make sure there is no error in case the small form is not open.
Your Me.Top = etc. ( and presumably ) Me.Left = etc., produce an error 'Method or Data member not found'. I did wonder when after typing Me. - Intellisense didn't offer these as options ?