|
-
Jun 11th, 2000, 04:46 AM
#1
Thread Starter
Lively Member
During my programming time from last year until now i was so frustrated with the Set Newform = new form1. Why? because after this line of code i can't access to form or any controls on the form. Until to day, i've found a piece of code that i thought it will help all of you have the same problem as i did, which is to have a copy of the form and can always have access to the form or its controls.
Dim NewForm1(1 to 50) as New Form1
'this will allow to you have up to 50 copy of Form1
'like this.
for every new copy you want to make just use an integer varible to create the number between 1 and 50 to the new form in the name of NewForm1(your-varialbe). if you have got a varible with the value 5 and the name of VarNum, then you NewForm will be like this.
NewForm(VarNum).show 'shows/create the form
To call the Form use:
NewForm(5).controls/properties 'use to edit controls or
'form's property.
-
Jun 11th, 2000, 09:16 PM
#2
Addicted Member
Newform=Form1
Seems like that would be more memory intensive than neccessary. You may not know it but all of the forms reside in an 'object' called the Forms Collection. It's kinda like the Control collection, in which all of the controls are stored. You can iterate through them when needed and call them by number.
You can do the same thing via the Forms object. You may wish to look it up in the help. This may solve your problem for you.
Eiredrake
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
|