Problems Using Form Objects Created using 'Set ... As New' as Dialogs

M

maurice.mcginley

Hi,

I'm trying to create dialogs using instances of forms using 'Set' the
'New' keyword

ReDim Preserve dialogForm(FormCount)

' Create a new instance that is of type UserForm1.
Set dialogForm(FormCount) = New UserForm1

I may have several instances of the same UserForm1 open at a time.

I want to open up an instance of the UserForm1 as a dialog from another
form (Form2), and return a value to the original Form2.

I can do it using the DoCmd.OpenForm method in Dialog mode, but I don't
know how to do it when I have multiple instances of the form class
(they all seem to have the same .name property).

My problem is I can't figure out:
1. How to access properties on a particular instance of the form. All
the instances seem to have the same name.

2. How to get the programatically created instance of UserForm1 to
behave modally (i.e., stop processing code in other forms until it is
closed or hidden) when it is called in a function.

3. How to close the hidden instances when I am done with them.
(Basically, I can't find the right way to address the unique
instances.)

Much appreciated if anyone has figured this out already.

with kind regards,

m
 
Top