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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop Up Form Placement 1

Status
Not open for further replies.

random75

Technical User
Apr 16, 2008
34
US
I have a calendar pop up form which I am using in 3 or 4 different forms for date selection. It is a single form which is called up by a button and makes use of global variables. Short of creating a different popup form for each main form where it is used, is there a way for having this popup form appear in different places (coordinates) in the different forms in which it is used. The form controls that the calendar works with are in different places (upper right, center, lower left, etc) in the different forms and I'd like the calendar to appear just to the right of each of those controls. One solution might be to have its location specified in relation to its call up button (which would be on the main form) if that's possible. Then it would alwys be where I'd like it to be. Thanks in advance for any help!
 
Have a look at the DoCmd.MoveSize method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks Remou...

The MoveSize method will solve my problem.

Now I need a way to differentiate each occurence of the form so that I can establish the placement based on the underlying form that the calendar was called from. I am trying to use this calendar form universally for 5 or 6 different forms so I thought I would use a series of 'if then else' statements with the MoveSize method, but I am not sure how to refer to the form sitting under my modal pop up calendar. My thinking was that I would establish which form is open underneath and place my calendar accordingly. Thanks for your help!


 
Below is my latest attempt to affect the placement of a modal pop up calendar form based on the specific form it is being called from. This code is at the beginning of the Form OnOpen event for the calendar. I believe this code will work (the MoveSize method does what I want it to do) but I am getting an Application-defined or Object-Defined Error message relating to my attempt to reference the form and I haven't been able to solve it.


Code:
Dim Frn As Object
Set Frn = Forms!ProductionEditBatchCreatedFromTemplateForm

If Form.Current = Frn Then
    DoCmd.MoveSize 8000, 5000
End If
 
You may consider to play with OpenArgs

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top