Hello,
My question is about creating User-Defined Data Types. Is there ANY way possible i can create a User-Defined Data Type that declares a variable of another User-Defined Data Type instead of the Pre-Defined User Types like String, Integer, etc?
The following explains my problem in more detail.
I know to create a User-Defined Data Type at the top of the module before any procedures. Like this:
In a procedure I would then declare a variable as that type using a Dim statement. Like this:Please Login or Register to view this content.
So, in the first code example above I created a User-Defined Data Type called CustomerInfo. And in that User-Defined Data Type I declared the variable Company and RegionCode as a String and Integer, respectively. String and Integer being, of course, Pre-Defined Data Types.Please Login or Register to view this content.
Then in the next code example I declared the variable in a procedure.
All that works just great.
BUT... Is there any possible way to create a User-Defined Data Type with a variable that is declared not as a Pre-Defined Data Type, like String and Integer, but instead is declared as another User-Defined Data Type?
It's my understanding an example would look like this:
The above would come at the top of the module, before the procedures. The only problem with this is that I didn't declare the variable EveryCompany using a Dim statement. That's something you have to do when using a User-Defined Data Type but not when using a Pre-Defined Data Type. However, the VBE won't allow me to use a Dim statement before the first procedure.Please Login or Register to view this content.
So, in light of this, is there ANY way possible i can create a User-Defined Data Type that declares a variable of User-Defined Data Type instead of the Pre-Defined User Types like String, Integer, etc.
Is there any workaround? I really want to create a hierarchy of Data Types...
Thanks for your help in advance!!! I really appreciate the guidance!
Bookmarks