Hi, i have two lists, and i want to cross reference them. The first only has 15 values and i want to take each value and lookup if it exists in the other lists that has 500 values and if it does i would like to cause a checkbox on a form to beocme ticked.
Have tried this but keeps crashing and can't see why?
Any ideas please?
My code:
Sub CheckForMatchingValues
Dim SearchList As List
Dim DataList As List
' Initialize lists
SearchList .Initialize
DataList.Initialize
' Test data
SearchList.AddAll(Array As Int("2", "33", "C19"))
DataList.AddAll(Array As int("2", "7", "489", "78", "33", "0", "1"))
' Uncheck checkbox first
RationalDataMapping.Checked = False
' Loop through List1
For Each item In SearchList
If DataList.IndexOf(item) > -1 Then
RationalDataMapping.Checked = True
Exit ' Stop if a match is found
End If
Next
End Sub
Have tried this but keeps crashing and can't see why?
Any ideas please?
My code:
Sub CheckForMatchingValues
Dim SearchList As List
Dim DataList As List
' Initialize lists
SearchList .Initialize
DataList.Initialize
' Test data
SearchList.AddAll(Array As Int("2", "33", "C19"))
DataList.AddAll(Array As int("2", "7", "489", "78", "33", "0", "1"))
' Uncheck checkbox first
RationalDataMapping.Checked = False
' Loop through List1
For Each item In SearchList
If DataList.IndexOf(item) > -1 Then
RationalDataMapping.Checked = True
Exit ' Stop if a match is found
End If
Next
End Sub