H
HSalim[MVP]
Hi,
The help files in Access VBA for Type Statement say
-----------
User-defined types are often used with data records, which frequently
consist of a number of related elements of different data types.
The following example shows the use of fixed-size arrays in a user-defined
type:
Type StateData
CityCode (1 To 100) As Integer ' Declare a static array.
County As String * 30
End Type
Dim Washington(1 To 100) As StateData
In the preceding example, StateData includes the CityCode static array, and
the record Washington has the same structure as StateData.
When you declare a fixed-size array within a user-defined type, its
dimensions must be declared with numeric literals or constants rather than
variables.
-------------
I Get an error: "can't assign to array" when I try this.
Public Type xx
xid(0 To 10) As Integer
xname As String * 30
xvalue As String * 255
End Type
Public Sub TestLevels()
Dim levels(0 To 10) As xx
levels.xid(1) = 1
End Sub
How can I use this?
Thanks for any help/advice.
Regards
Habib
--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 21
--------------------------------------------
Share your knowledge. Add your favorite questions and answers
Help add questions to this site! We want Your input.
The help files in Access VBA for Type Statement say
-----------
User-defined types are often used with data records, which frequently
consist of a number of related elements of different data types.
The following example shows the use of fixed-size arrays in a user-defined
type:
Type StateData
CityCode (1 To 100) As Integer ' Declare a static array.
County As String * 30
End Type
Dim Washington(1 To 100) As StateData
In the preceding example, StateData includes the CityCode static array, and
the record Washington has the same structure as StateData.
When you declare a fixed-size array within a user-defined type, its
dimensions must be declared with numeric literals or constants rather than
variables.
-------------
I Get an error: "can't assign to array" when I try this.
Public Type xx
xid(0 To 10) As Integer
xname As String * 30
xvalue As String * 255
End Type
Public Sub TestLevels()
Dim levels(0 To 10) As xx
levels.xid(1) = 1
End Sub
How can I use this?
Thanks for any help/advice.
Regards
Habib
--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 21
--------------------------------------------
Share your knowledge. Add your favorite questions and answers
Help add questions to this site! We want Your input.