BluePlastic
New member
- Local time
- Today, 13:00
- Joined
- Nov 3, 2006
- Messages
- 5
Hiya
I have a function that accepts a string variable that is the name of a form (e.g. "frmMain") and I need to create a new instance of the form, which I can't use the New word to do as it doesn't accept a string variable - so I was expecting to use CreateObject:
Sub subA (pstrFrmName as string)
Set gfrmAny = CreateObject("MyDB.form_" & pstrFrmName)
End Sub
But I receive error 'ActiveX component can't create object'
Any ideas please?!
I have a function that accepts a string variable that is the name of a form (e.g. "frmMain") and I need to create a new instance of the form, which I can't use the New word to do as it doesn't accept a string variable - so I was expecting to use CreateObject:
Sub subA (pstrFrmName as string)
Set gfrmAny = CreateObject("MyDB.form_" & pstrFrmName)
End Sub
But I receive error 'ActiveX component can't create object'
Any ideas please?!