When the request is a Union request, you cannot update the data in the request.
http://support.microsoft.com/kb/328828
When Access concatenates rows from different tables in a join query, individual rows lose their base table identifier. Access cannot know which table you want to update when trying to change a row in a join request, so it disallows all updates.
Change the following question:
Perhaps you can get around this using VBA and ADO to update the corresponding table. The way I would approach this would be to make sure that the union table contains a column with an identifier from the source table and another column that indicates the source table.
eg. in your union you will have something like this:
SELECT 'Table1', id, ... FROM Table1 UNION SELECT 'Table2', id, ... FROM Table2
Then, through the data entry form and VBA, you can look at the values โโof the current selected row and update the corresponding table.
EDIT 2: for onedaywhen
Inserts values โโinto a table using Access VBA
Option Compare Database Option Explicit Public Sub InsertDataPunk(TargetTable As String, IdVal As Long, MyVal As String) Dim conn As ADODB.Connection Set conn = CurrentProject.Connection Dim sql As String 'You could build something fancier here sql = "INSERT INTO " & TargetTable & " VALUES (" & IdVal & ",'" & MyVal & "')" Dim cmd As ADODB.Command Set cmd = New ADODB.Command Set cmd.ActiveConnection = conn cmd.CommandText = sql cmd.CommandType = adCmdText cmd.Execute End Sub InsertDataPunk "Table2", 7, "DooDar"
pjp
source share