Dim dct As Object
Dim rst As Recordset
Dim keys As Variant
Dim key As Variant
Dim strPreviousGUID As String
Set dct = CreateObject("Scripting.Dictionary")
Set rst = CurrentDb.OpenRecordset("CDM_Data")
strPreviousGUID = ""
With dct
Do While Not rst.EOF
If Nz(rst("BO-Identifier"), "") <> "" Then
If (Not .Exists(Replace(rst("BO-Identifier"), "-", ""))) Then
Debug.Print "Previous GUID: " & strPreviousGUID
Debug.Print "Current GUID: " & rst("BO-Identifier")
.Add Replace(rst("BO-Identifier"), "-", ""), rst("BO-Description/Definition")
Debug.Print Replace(rst("BO-Identifier"), "-", "")
End If
strPreviousGUID = Nz(rst("BO-Identifier"), "")
End If
rst.MoveNext
Loop
End With
Debug.Print "Dictionary Count = " & dct.Count
keys = dct.keys
For Each key In keys
Debug.Print dct.Item(key)
Next key
Exit_Sub:
Exit Sub
Err_Handler:
MsgBox Err.Description
Debug.Print Chr(10)
Debug.Print Err.Description
Resume Exit_Sub
|