What I found in my dabbling is that you need 2 loops with 1 array each. Taking each element in the outer loop, check for it in the inner loop. Add 1 to counter if found. If the counter = Ubound of the second array +1 then all elements of the 1st array are found in the 2nd array, meaning complete. I decided to use a query to run the function.
@June7; Not stated if that's air code or not, but if it works my hat's off to you.
SQL
Code:
SELECT tblAudio.Audio, tblAudio.DeliveredAudio, updatestatus([audio],[DeliveredAudio]) AS Status
FROM tblAudio;
SINGLE FUNCTION
Code:
Function UpdateStatus(strAudio As String, strDeliveredAudio As String) As String
Dim aryAudio() As String, aryDeliveredAudio() As String
Dim i As Integer, n As Integer, c As Integer
aryAudio = Split(strAudio, ",")
aryDeliveredAudio = Split(strDeliveredAudio, ",")
If UBound(aryAudio) > UBound(aryDeliveredAudio) Then
'Incomplete - audio exceeds delivered audio
UpdateStatus = "Incomplete"
Exit Function
End If
For i = 0 To UBound(aryAudio)
For n = 0 To UBound(aryDeliveredAudio)
If aryAudio(i) = aryDeliveredAudio(n) Then c = c + 1
Next
Next
If c = UBound(aryAudio) + 1 Then 'add 1 to UBound because it's zero based
UpdateStatus = "Complete"
Else
UpdateStatus = "Incomplete"
End If
End Function
Seems to work, but I only used the 3 records from original post.