Hi,
Is there a simple way to sort the following User Defined Type on OrdNo?
Public Type Orders
OrdNo as String
InvNo as string
End Type
Sub Main
dim Order() as Orders
ReDim Order(3)
Order(0).OrdNo = "3"
Order(0).InvNo = "556"
Order(1).OrdNo = "1"
Order(1).InvNo = "333"
Order(2).OrdNo = "4"
Order(2).InvNo = "251"
Order(3).OrdNo = "0"
Order(3).InvNo = "952"
'How to Sort by Order().OrdNo???
Previously and without using a User Defined Type, I would have assinged the OrdNo and InvNo to the same element in an array and then sorted an array.
strArray(0) = Left("3" & space(20), 20) & left("556" & space(20), 20)
strArray(1) = ...
strArray(2) = ...
strArray(3) = ...
'
SortArray strArray()
Any ideas would be appreciated.
thanks,
pat
Is there a simple way to sort the following User Defined Type on OrdNo?
Public Type Orders
OrdNo as String
InvNo as string
End Type
Sub Main
dim Order() as Orders
ReDim Order(3)
Order(0).OrdNo = "3"
Order(0).InvNo = "556"
Order(1).OrdNo = "1"
Order(1).InvNo = "333"
Order(2).OrdNo = "4"
Order(2).InvNo = "251"
Order(3).OrdNo = "0"
Order(3).InvNo = "952"
'How to Sort by Order().OrdNo???
Previously and without using a User Defined Type, I would have assinged the OrdNo and InvNo to the same element in an array and then sorted an array.
strArray(0) = Left("3" & space(20), 20) & left("556" & space(20), 20)
strArray(1) = ...
strArray(2) = ...
strArray(3) = ...
'
SortArray strArray()
Any ideas would be appreciated.
thanks,
pat