mrmcg
mrmcg

Reputation: 193

VBA - New (Blank) Record - Disabled

I am running Access 2010. On the form that we have the New (Blank) Record is disabled. We need to have this enabled. This has worked on previous versions of access on the same program.

Allow Additions = Yes

Data Entry = Yes

Calling a SQL Stored Procedure.

I added some code and created a button to add a new record...

Private Sub save_Click()
    Dim ctl As Control
    For Each ctl In Me.Controls
        Select Case ctl.ControlType
            Case acListBox
                If Len(ctl.ControlSource) = 0 Then
                    ctl.Value = Null
                End If
            Case acCheckBox
                ctl.Value = 0
            Case acTextBox
                ctl.Value = ""
        End Select    
    Next
End Sub

It gave me this message:

Run-Time error '3326' This recordset is not updateable.

I am not sure on what else to try. Any ideas?

Upvotes: 0

Views: 579

Answers (1)

Gustav
Gustav

Reputation: 55806

Calling a SQL Stored Procedure.

Such queries will never be updatable.

You can pull the result set from the query and write it to a temp table (local or on the server), update this, and write the modified data back to the source table(s).

Upvotes: 0

Related Questions