-
Is it possible to make a public array of TYPE.
example. I created the followin type and placed it inside a module.
Public Type CUsers
UserName As String
IP_Address As String
End Type
On a Form I tried the following :
Dim Students as Public CUsers
I got an error.
Is there a way to work around that?
------------------
OmarSwan
[email protected]
http://www.omarswan.cjb.net
To God Be The Glory
-
I thought the syntax for declaring a public variable like this was:
Public Students as CUsers
And I'm pretty certain you can make an array of a user-defined type. I've done it before.
-
Yes it is possible but check your declarations. It should read something like this.
Public Type CUsers
UserName As String
IP_Address As String
End Type
Then in a Module.
Global udtUsers() as CUsers.
or
Public udtUsers() as CUsers.
Now when you add items to the array use the redim preserve.
I hope this helps.
------------------
-----------------------
Maartin
[email protected]
-----------------------
-
Just remove the "Public" portion of your Dim when you want to use your user defined type, so the following works:
Dim Students as CUsers
------------------
Marty