Access VBA: Scripting.Dictionary - Dump to Table?
<p>Thanks to the helpful hand provided earlier, I have a functional approach to compute Word Frequency among strings in a recordset.  The following code produces the desired result.</p>

<p>Last step will be to dump the dictionary structure into an Access table in the currentDB.  I can step thru each key as commented out below and append to a table via SQL - but it is very slow w/24K terms.</p>

<p>UPDATED >> w/Solution &lt;&lt;</p>

<pre><code>Private Sub Command0_Click()

Dim counts As New Scripting.Dictionary
Dim word As Variant
Dim desc As String

Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset  '&lt;&lt; solution
Dim strSQL As String
Dim db As Database

Set db = CurrentDb

strSQL = "SELECT DISTINCT Items.Description FROM Items ;"

Set rs1 = db.OpenRecordset(strSQL, dbOpenDynaset)

Do While Not rs1.EOF
    For Each word In Split(rs1!Description, " ")
        If Not counts.Exists(word) Then
            counts.Add word, 1
        Else
            counts.Item(word) = counts.Item(word) + 1
        End If
    Next
    rs1.MoveNext
Loop

'&gt;&gt; .AddNew Solution inserted as suggested below &lt;&lt;

rs2 = db.OpenRecordset("Freq", dbOpenTable)  

For Each word In counts.Keys
    With rs2
       .AddNew             ' Add new record
       .Fields!Term = word
       .Fields!Freq = counts(word)
       .Update
       .Bookmark = .LastModified
    End With
Next

rs2.Close

'&gt;&gt; End Solution &lt;&lt;

Set rs1 = Nothing
Set rs2 = Nothing

MsgBox "Done"

End Sub
</code></pre>

<p>Question:</p>

<ol>
<li>Can I dump the Dictionary into a table in BULK, vs stepping thru the Keys one-by-one? </li>
</ol>

<p>Rationale:  Easier (for me) to perform downstream presentation &amp; manipulation using a table structure.</p>

<p>Thanks!</p>