I want to use the same Dynamic array in a number of forms in a project.
How can I do that ?
Thanks
Xzyeena.
Printable View
I want to use the same Dynamic array in a number of forms in a project.
How can I do that ?
Thanks
Xzyeena.
Add a code 'Module' to your project.
Then in the module, declare public variables and functions that you want all forms to have access to.
Keyboard shortcut: ALT+P , M
Is that what you're looking for?:)
Where Do i Type the ' Module' ?
I have 7 forms and i want to use an array across these 7 forms.
Can I write this in the first form ? under Declarations ,option Explicit ?
Thanks.
Anything variables you type in the forms won't be visible to the other forms.
Like I said, add a module. I gave you the keyboard shortcut.
When you create a module, it will be listed in the project explorer if you have that window open.
A module just holds code that all forms can use, given that variables and functions are defined "Public"
In the module:
Public strArray() as String
If you don't understand the keyboard shortcut, you might want to learn. I find them very useful at times.
With the mouse, you can click on the Project menu, then goto "Add Module".
Do you have it now?