>Hi there!
>
>I want to use a variable (defined in main procedure) in the properties of an object.
>
>E.g.
>I have a dataset (object) in a Form.
>
>I want the properties of that object i.e
>
>DatabaseName to have as value a variable that has been defined in my main module.
>
>The variable drives a path name from an Ini file. So far it's Ok.
>
>But I'm not able to pass the value of this variable(which now contains the path) to the property DatabaseName.
>
>Is it possible to give as value a variable name in the DatabaseName property ?
>
>Or I'm compelled to give the path itself as value in the property ?
>
>Thx.
>Akshay
You have to do it the way I just wrote in my last message, ie:
data1.DatabaseName = YourVariable
data1.Refresh
You can't put your variable name in the properties of the object. The reason is that things that are in the properties are compiled and therefore need to be constant. If you variable (your case), you have to assigned it at design time just like the sample I give you.
Is it answering your question?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com