Is there a way to open a form using [highlight #FF99FF]Application.CurrentProject.ALLFORMS. [/highlight]
If have a treeview menu where the user selects the form to open, I'am currently using the DoCmd.OpenForm, which works fine. I however want to set an object variable to the form from the [highlight #FF99FF]Application.CurrentProject.ALLFORMS. [/highlight].
I have the following code to list all the forms
Thanks
If have a treeview menu where the user selects the form to open, I'am currently using the DoCmd.OpenForm, which works fine. I however want to set an object variable to the form from the [highlight #FF99FF]Application.CurrentProject.ALLFORMS. [/highlight].
I have the following code to list all the forms
Code:
Public Function StrForm(strName as string) as object
Dim obj as AccessObject
dim dbs as object
set dbs=Application.CurrentProject
For Each obj In dbs.ALLFORMS
If strName = obj.Name Then
Set StrForm = obj
Exit For
EndIf
Next
Set obj = Nothing
Set dbs = Nothing
Exit Function