Re: Using variable or Label
Six of one, half a dozen of another. Depending upon what you need to do with the data you can either use a variable you can set the Data Type when you dimensioned the variable or if you are displaying it you can just as easily change to the necessary data type (i.e, cLng, cStr, etc.)
Re: Using variable or Label
Thanks Mark.
Any other point of view, people?
Re: Using variable or Label
It's better coding practice to store all data in variables (of the appropriate data type), and then display those variables in a label/textbox later.
This way you always have the data in its correct form in memory and you don't have to convert a label or textbox (string) back into the right data type.
Re: Using variable or Label
I have some thought like that too DigiRev.
But will it suffer (little bit or a lot) performance of our application if we have to many variable? Not to mention if we working with MDI form with no limitation for user to open the same Form.
Re: Using variable or Label
Labels and textbox is just a controls you can use to display data from your database. Any calculation can be made using value from label or textbox but it is necessary to convert them into specific datatype using datatype conversion like cstr(), clng() and so on. You can also use data read directly from database by first storing them in variables with appropriate datatype for your calculation like what digirev suggested.