Find Existing Value in Array of Array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Peeps,

I need help with trying to find a value in array of arrays.

Public Module myModule
Private Site_Access() As Array
Property Set_SA()
Get
Return Site_Access
End Get
Set(ByVal value)
On Error GoTo Handler
ReDim Site_Access(0)
Site_Access(Site_Access.Find(Site_Access, value(0))) = value
Handler:
Select Case Err.Number
'.... goes to sub procedure code to copy and reassign array
if does not exist
End Select
End Set
End Property
End Module

the values for "value" consist of string in array:

value(0)="Login_ID"
value(1)="http://testsite/admin/"
value(2)="http://testsite/userform/"

i do not want to use a loop or while statement.

I tried the above, but no luck. Please help.


Thanks in advance


Ros
 
Public Module myModule
Private Site_Access() As Array
Property Set_SA()
Get
Return Site_Access
End Get
Set(ByVal value)
On Error GoTo Handler
Dim intC As Integer
1:
If IsArray(Site_Access) Then
Site_Access(Site_Access.Find(Site_Access, value(0))) = value
Else
ReDim Site_Access(0)
Site_Access(0) = value
Resume 1
End If
Handler:
Select Case Err.Number
Case Is = 91

'.... goes to sub procedure code to copy and reassign
array if does not exist
End Select
End Set
End Property
End Module

Sorry peeps,

did not mean to include the "ReDim" in the wrong line. above is the actual
code.


Ros
 
Never mind peeps, i figured it out... thanks anyways. used the following code


Site_Access.Find(Site_Access, AddressOf Return_String)


Ros
 
Back
Top