i need to know the coding to make a global string i know its dim pop As String but where do i put it to be a global string????
its been a little while, but i think you have to make a new module, and then declare the variable as public in the module: Code: Public pop as String
uhh, try file>new>module or find the menu somewhere to add a new module. then go into the code of the module (itll appear with the forms) and add that code above. i think.
Can't you just pop it in the 'General Declarations' ? Only really need a module if theres more then one form.
Open up the project and go to the "project explorer" window. Right click the folder or any project item for the project and select add->module. This will create a module (.bas) file. This will open up a dialog window. Just select OK - you can rename it later. You can then declare your vaiables into the file and scope them using the standard access modifiers (public, private, etc.) e.g. Private Const my_private_constant_global_string As String = "constant value" Public Const my_public_constant_global_int As Integer = 34
Try to avoid using global variables if possible; it makes for sloppy code. One of VB 's Object Orientated ways to pass variables to a different form is using the "Get" and "Let" property. Here is a link which explains it: http://www.developerfusion.com/show/3959/7/ Let me know if you try this route and need any help.