If u have 2 pop up forms opened, a large one and a smaller one, is there any way they can be both worked on and the smaller one always stay on top? Just like when u work in a form in design view in access, the property sheet is always on top and u can work on both. thanks
work on 2 pop up forms
Collapse
X
-
Just a guess here, but maybe you could something with the OnFocus of the bigger form. When that form gains the focus you fire an event in the subform that puts the focus on an object in the subform and then then the same event in the main form puts the focus back on itself. So if you switch to another program, both forms might go to the background but when you come back to the main form you will make both forms on top any other open windows.
JimComment
-
Sorry but if both forms are popups, there shouldn't be a problem
If the smaller popup is opened by clicking a button on the larger popup, it should always be on top.
If the second form was already open when the first form is opened, it will go to the back of the 'z-order'. However clicking the button on the first form will restore it to the top.
Very basic example attached.
Of course, clicking on the larger form will restore focus to that and hide the smaller form if located in the same place. But you can click the button again ...
OR just move the smaller form to one side.
OR change the larger form so it isn't a popup!Attached FilesComment
-
One simple method is to add code to the Detail_Click event of the large (blue) form which closes the smaller (yellow) form.
To show when the yellow form is being reopened, I've added a message to the Form_Load event of that form.
Adapt as appropriate to suit your requirements.Attached FilesComment
-
Neruda,
You can add the code that runs on the OnLoad Event anywhere in your form. There is nothing that says it must be in the OnLoad event.
Just make it a public sub/function and refer to it from the other form when you need to:
Hope that hepps!Code:Call Forms![FormName].[Sub/FunctionName]
Comment
-
Thank u for your answers, in the end I have done what u suggested and also added this code to hide the smaller form once it loses focus
Code:Private Sub Form_Timer() ' error trap is used to process situations when not a form is clicked outside of the popup form On Error GoTo NotForm: If Me.Name = Screen.ActiveForm.Name Then Exit Sub NotForm: Me.TimerInterval = 0 Me.Visible = False End SubComment
Comment