Excel 2003 Win XP
I have a large (physically) userform one control of which calls another
(smaller) UF.
Sometimes the smaller form, when called, appears on top of the larger one
which is the required result.
However sometimes it is beneath or hidden by the larger one which is not the
required result.
If I minimise the larger form, move the smaller one to where part of it is
visible
when the larger one is maximised again, then click the smaller form itself,
(not a control) then all the form is on top of the larger one.
I have tried repaint to no avail.
How can I ensure the smaller form, when called, always appears on top of the
larger one.
Could I click the smaller form programmatically.
donwb
Mark Ivey - 24 Mar 2008 12:31 GMT
Is it necessary for both userforms to be open at the same time?
If so, you might play around with their positions when they are initialized.
Or maybe you should consider a different type of Userform control (page or
tab feature) to encase everything you need on the main form.
If it is not necessary for them both to be open at the same time, I would
highly recommend hiding one whenever the other is initialized.
Mark
> Excel 2003 Win XP
> I have a large (physically) userform one control of which calls another
[quoted text clipped - 14 lines]
> Could I click the smaller form programmatically.
> donwb
donwb - 24 Mar 2008 13:27 GMT
Hi Mark
Thanks for the response.
That's the "guaranteed" fix.
But I had hoped to keep the main form visible all the time.
There must be some way.......
donwb
> Is it necessary for both userforms to be open at the same time?
>
[quoted text clipped - 26 lines]
>> Could I click the smaller form programmatically.
>> donwb
Mark Ivey - 24 Mar 2008 14:00 GMT
Have you played around with the FOCUS features?
Mark
> Hi Mark
> Thanks for the response.
[quoted text clipped - 33 lines]
>>> Could I click the smaller form programmatically.
>>> donwb
donwb - 24 Mar 2008 14:33 GMT
I did try to set the focus on the smaller UserForm but
UserFormXX.SetFocus was rejected.
Then I tried to set the focus to one of the form's controls, as in
UserFormXX.CommandButtonYY.SetFocus
and although that was accepted, the UF stayed hidden behind the large one.
donwb
> Have you played around with the FOCUS features?
>
[quoted text clipped - 37 lines]
>>>> Could I click the smaller form programmatically.
>>>> donwb
Mark Ivey - 24 Mar 2008 14:37 GMT
What about the SHOWMODAL properties? Maybe they can help with this
problem...
Mark
> I did try to set the focus on the smaller UserForm but
> UserFormXX.SetFocus was rejected.
[quoted text clipped - 44 lines]
>>>>> Could I click the smaller form programmatically.
>>>>> donwb
Patrick Molloy - 24 Mar 2008 14:48 GMT
Mark got the right answer, when showing the second form, set it to modal
Private Sub CommandButton1_Click()
UserForm2.Show vbModal
End Sub
> Excel 2003 Win XP
> I have a large (physically) userform one control of which calls another
[quoted text clipped - 13 lines]
> Could I click the smaller form programmatically.
> donwb
donwb - 24 Mar 2008 16:26 GMT
Thanks Patrick & Mark
Setting the forn to ShowModal=True solved it.
donwb
> Mark got the right answer, when showing the second form, set it to modal
>
[quoted text clipped - 23 lines]
>> Could I click the smaller form programmatically.
>> donwb
Mark Ivey - 24 Mar 2008 16:29 GMT
Glad to help out...
I was just guessing from my experiences, but Patrick provided the real
fix... thanks for you input Patrick.
Mark
> Thanks Patrick & Mark
> Setting the forn to ShowModal=True solved it.
[quoted text clipped - 28 lines]
>>> Could I click the smaller form programmatically.
>>> donwb