Search code examples
sql-serverformsvbams-access

Continuous Form not allowing edits


I need a continuous form to allow edits on one column, although I will take any at this point.

The form level settings are set as follows: AllowEdits: Yes; AllowDeletes: Yes; AllowAdditions: Yes;

The form controls settings: Enabled: Yes; Locked: No;

The Record Source is a query with these settings: Record Locks: No Locks; Recordset Type: Dynaset;

The query pulls from a MS SQL server table that is set up in MS Access as a linked table, and I have admin rights on the SQL server.

I have attempted remaking the a simplified version of the form, and it still does not allow edits. I have other continuous forms sourced from different tables that can be edited, but whenever I try on the form in question, nothing happens. It seems like it would be at the table or query level. Is there a setting I am missing?

Edit: The query is pulling from two tables -

dbo_tbl_controls (PK StatOrig - Text) and

dbo_tbl_statspkgdata (PK Stat - Text; VType - Text; Yr - Number and others)

The relationship is one to many on StatOrig = Stat. I need the controls table for the sort order.


Solution

  • With an SQL Server back-end it is essential that you have relevant unique indexes on any table or view that you wish to edit. Check all indexes to make sure they are appropriate.

    You can create an index for a view in VBA like so:

    db.Execute "CREATE UNIQUE INDEX uiId ON someview (Id) WITH PRIMARY"