MS Access Select All Check Box for a Combobox Bound to a Sharepoint Multivalue Field
<p>Alright, after a few weeks of trying to figure this out, and (I think) getting 99% of the way there, I have had to admit defeat, join Stack Overflow, and post my question. I apologize if my question etiquette isn't superb, but here goes;</p>

<p>As the title implies, I am trying to create a select all checkbox for a combobox in an Access 2010 form. This combobox is bound to a multivalue field that is part of a SharePoint list (all of the tables in our database are stored as SharePoint lists and linked to the Access file. The Access file is effectively a front end).</p>

<p>I have managed to get this to work in a test database that is not linked to SharePoint, but I can't seem to get it to work in our actual linked database. Here is the code from the test database that runs when the checkbox is clicked. Note that [Test] is the name of the multivalue field I defined in this example. It is a lookup field that gets its possible values from another simple table in the database.</p>

<pre><code>Private Sub testcheck_Click()
    Dim counter As Integer
    Dim rst As DAO.Recordset

    Set rst = Me.Recordset

    If testcheck.Value = True Then
        With rst
            .MoveFirst
            .Edit
            For counter = 0 To Me.testcombo.ListCount - 1
                With !Test.Value
                    .AddNew
                    .Value = Val(Me.testcombo.Column(1, counter))
                    .Update
                End With
            Next counter
            .Update
        End With
    ElseIf testcheck.Value = False Then
        Me.testcombo.Value = Array()
    End If

End Sub
</code></pre>

<p><a href="http://i.stack.imgur.com/PIY1Y.png" rel="nofollow">Snapshot of my test form</a></p>

<p>When I try to run the above code in my actual database, it throws an error when it gets to the .MoveFirst command. The error is run time error 3426: "This action was cancelled by an associated object". I'm quite confident that it thinks I'm trying to move to a different record while still editing the current record (even though there is only one). From here, I've figured out that, when running the code in the test database, that little pencil icon in the top left corner of the form (which I assume means you are editing the record) is replaced by a black triangle when it gets to the .MoveFirst command. This does not happen in my actual database. I have no idea why the discrepancy, and I don't fully understand what it means. If anyone has an idea of how to fix this, I would be very appreciative to the input.</p>

<p>I should note that my code only works if the form has already created a record to edit. I have a work around, but that tangent is beyond the scope of this question. </p>