Multiple Instances Of A Form Returning A Value

D

Devlin

I am interested to learn if anyone has a solution to open multiple instances
of a form that returns a value when closed.

I understand the fundamentals of opening multiple instances with the New
keyword. Pausing the code while waiting for the form to close is another
story.

Any assistance is appreciated.
 
A

Alex White MCDBA MCSE

You need a modal form, will take the foreground and when closed the calling
sub/function can then continue.
 
D

Devlin

Modal or not, when opening a new instance of the form using the "New"
keyword, code processing continues. Additionally, processing must continue
until the command to make the form visible has been reached. It is at this
point that execution needs to be paused until the form is closed.
 
A

Allen Browne

If there are multiple instances running, then presumably the original code
that opens these instances has been called multiple times.

It seems to me that the easiest solution would be to move the remaining part
of the procedure that must run after the instance closes into the Unload
event of the form, so that each instance can handle its own values
independently of the other instances, and complete the correct branch
without affecting the other instances of the original procedure.
 
Top