Dave Punky
Board Regular
- Joined
- Jan 7, 2010
- Messages
- 133
Hi all,
I'm having a minor issue and was wondering if anyone had got around this.
Basically I've got a Userform (that's modeless) which acts as a primary hub for information. I then have several other Userforms that open from this which ideally I would want to act modally (or really just dominates focus until the form is submitted / closed).
I've been defining the forms as Modal on initialize like so:
The only downside to doing this is on the then opened userform, once that form is terminated it seems to terminate the primary Userform also (even though the only code left to run is to end the sub). The only way around this I've managed to find is by doing the following in the "dominant" userform:
The only downside I've noticed to this is that it takes focus away from the primary form, and because Userforms initially don't appear to have a .SetFocus it doesn't seem possible to give focus back without the user clicking the form (and if the button was launched from a frame, that particular frame seems to need to be clicked).
I'm thinking setting Modal / Modeless probably isn't the best way around this, so is there any other ways of doing this (which may be better suited to my needs)?
I'm having a minor issue and was wondering if anyone had got around this.
Basically I've got a Userform (that's modeless) which acts as a primary hub for information. I then have several other Userforms that open from this which ideally I would want to act modally (or really just dominates focus until the form is submitted / closed).
I've been defining the forms as Modal on initialize like so:
Code:
Userform.show vbModal
The only downside to doing this is on the then opened userform, once that form is terminated it seems to terminate the primary Userform also (even though the only code left to run is to end the sub). The only way around this I've managed to find is by doing the following in the "dominant" userform:
Code:
Sub Userform_Terminate
Userform.show vbModeless
End Sub
The only downside I've noticed to this is that it takes focus away from the primary form, and because Userforms initially don't appear to have a .SetFocus it doesn't seem possible to give focus back without the user clicking the form (and if the button was launched from a frame, that particular frame seems to need to be clicked).
I'm thinking setting Modal / Modeless probably isn't the best way around this, so is there any other ways of doing this (which may be better suited to my needs)?