Create mulitiple nondefault Instances with New operator for Microsoft Access Form

40 Views Asked by At

I've a Microsoft Access form named frmProducts. To show simultaneously 2 products, I need 2 instances of this form. I've also frmMembers, frmOrders, ....

What's the general way to create a new instance of an opened form with its name?

The only working way is this:

dim frm As Object
Set frm = New Form_frmProducts

But none of the following code works (they are all errors):

Function duplicateOpenedForm(ByVal frmOpened As Object)

  Set duplicateOpenedForm = New "Form_" & frmOpened.Name

  Set duplicateOpenedForm = New Forms(frmOpened.Name)

  Eval "Set duplicateOpenedForm = New Form_" & frmOpened.Name

  Set duplicateOpenedForm = Eval("New Form_" & frmOpened.Name)

End Function

Please give you a method for this?

0

There are 0 best solutions below