|
-
Dec 23rd, 2002, 10:23 AM
#1
Thread Starter
New Member
Open or Load a form ( urgent )
Hi,
I'm trying to load into memory or open dinamicaly the forms in my program but a don't know how to do it?
IF I DO IT LIKE THAT I ONLY GET THE CURRENT FORM NAME
Public Function FormName() As Form
Dim frm As Form
Dim i as Integer
i = 0
For Each frm In Forms
i = i + 1
Set gNomesForms(i) = Forms(i)
Next
End Function
Select case is out of question.
Best Regards
Luis Moura
-
Dec 23rd, 2002, 10:37 AM
#2
Junior Member
Try using:
Load frmName
This will load your form but not show it. Then when you want to show it use:
frmName.Show
If you want it hidden again us:
frmName.Hide
To close your form use:
Unload frmName
HTH;
Ancient Chinese proverb I just made up:
Those who know the least have the most to say!
-
Dec 23rd, 2002, 10:42 AM
#3
Retired VBF Adm1nistrator
The "Forms" collection only returns forms that are already loaded
-
Dec 23rd, 2002, 10:43 AM
#4
Thread Starter
New Member
Thanks for answer
that works fine if a want to load only one form, but i need to load all the forms and then open the form that the user select.
-
Dec 23rd, 2002, 10:58 AM
#5
how are they 'selecting' a form to open?
-
Dec 23rd, 2002, 11:01 AM
#6
Thread Starter
New Member
What do you mean "how are they 'selecting' a form to open"
-
Dec 23rd, 2002, 11:05 AM
#7
You are the one that said the user is selecting a form. What does the user do to select a form?
-
Dec 23rd, 2002, 11:10 AM
#8
Thread Starter
New Member
When he/she press enter in the msflexgrid to choose the mext form
-
Dec 23rd, 2002, 11:16 AM
#9
So the forms are listed in the grid and they select one and hit enter?
-
Dec 23rd, 2002, 11:22 AM
#10
Thread Starter
New Member
Yes, in that msflexgrid i have an hiden column with the name of the form, when the user press enter into certain item of the msflexgrid, then it should open that form.
I could do it manual like case select, but this program has about 50 forms.
-
Dec 23rd, 2002, 11:26 AM
#11
The Select Case was what I was going to suggest. That is the only option Im sorry to say.
-
Dec 23rd, 2002, 11:37 AM
#12
Thread Starter
New Member
Thanks any way.
Please just look at this.
I'st possible to set a var with all the names of the forms and then open the form direct???
For example:
Dim fFormName(100) as Form
i = 0
With rst
Do While Not .Eof
i = i +1
Set fFormName(i) = !FormName
.MoveNext
Loop
End With
'Open the form
i = 0
For i = 0 To 100
if fFormName(i) = sFormChoosed Then fFormName(i).Show
Next
Thanks
-
Dec 23rd, 2002, 11:41 AM
#13
No because if the form is not loaded you cannot check its name. You would have to load every form to get that to work and that would bad.
-
Dec 23rd, 2002, 11:44 AM
#14
Thread Starter
New Member
Cander thanks a lot for your colaboration.
I whis you the best holidays.
Luis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|