By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,583 Members | 617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,583 IT Pros & Developers. It's quick & easy.

Find Existing Value in Array of Array

P: n/a
Ros
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
Jul 12 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Jul 12 '06 #2

P: n/a
Ros
Never mind peeps, i figured it out... thanks anyways. used the following code
Site_Access.Find(Site_Access, AddressOf Return_String)
Ros
"Ros" wrote:
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
Jul 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.