My Form accesses a Query as follows :
This gives me all the rows from tblA, with tblB columns B & C, when present,
and also all the rows from tblB for those rows with no matches in tblA.
In my Form, however, I would now like the ability to update tblB.C,
via a dropdown in a Combi-Box.
I know that accessing a Query for the data does not really lend itself for such an update, but is it possible to build in an [Event Procedure] for tblB.C to perform my update ?
I tried this on “On Change”, but it didn’t work :
The amended value from the dropdown was not redisplayed,
nor was tblB.C updated.
Or am I attempting the impossible ?
Many thanks
Code:
SELECT tblA.A, tblB.B, tblB.C FROM tblA LEFT JOIN tblB ON tblA.A = tblB.A UNION SELECT tblB.A, tblB.B, tblB.C FROM tblB LEFT JOIN TblA ON tblB.A = TblA.A WHERE tblB.A not in (select TblA.A from TblA)
and also all the rows from tblB for those rows with no matches in tblA.
In my Form, however, I would now like the ability to update tblB.C,
via a dropdown in a Combi-Box.
I know that accessing a Query for the data does not really lend itself for such an update, but is it possible to build in an [Event Procedure] for tblB.C to perform my update ?
I tried this on “On Change”, but it didn’t work :
Code:
Private Sub C_Change(NewData As String) Dim strSQL As String If NewData = "" Then Exit Sub strSQL = "update tblB set tblB.C = NewData;" CurrentDb.Execute strSQL, dbFailOnError Response = acDataErrAdded End Sub
nor was tblB.C updated.
Or am I attempting the impossible ?
Many thanks
Comment