0

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?

jacouh
  • 8,473
  • 5
  • 32
  • 43
  • Can you specify the error you are receiving from the four lines you've tried? – K.Dᴀᴠɪs May 17 '21 at 18:11
  • Review http://allenbrowne.com/ser-35.html and https://stackoverflow.com/questions/37710986/access-2007-vba-multiple-instances-of-form-update-controls-on-specific-inst – June7 May 17 '21 at 18:24
  • Thanks for all, I've checked those links, no general way found... – jacouh May 17 '21 at 18:58

0 Answers0