fiogf49gjkf0d I'm stuck. I'm hoping it's something simple and I'm just missing it
I have a simple form bound to a PARENT table with a TDataGrid of records from a related CHILD table. Double-clicking on the grid opens the data-edit form for CHILD.
CHILD is a simple construct of 5 date fields, a lookup and a picklist.
Updating any of the dates is fine, and is written back okay. So is updating the lookup value.
The trouble is that any changes to the picklist cause the changes to be lost, and I've found a symptom (cause?) in the SlxProfiler.
The executed SQL is:
UPDATE CHILD
SET MODIFYUSER=[DBTYPE_STR,"U6UJ9A000008"], MODIFYDATE=[DBTYPE_DBTIMESTAMP,20110118 15:30:56.000], ASSESSMENTSTATUS=[DBTYPE_STR,"rejected"]
WHERE CHILDID=[DBTYPE_STR,"Q5FRNA08TZ2E"] AND MODIFYUSER=[DBTYPE_STR,"U6UJ9A000008"] AND MODIFYDATE=[DBTYPE_DBTIMESTAMP,20110118 15:24:28.000] AND ASSESSMENTSTATUS=[DBTYPE_STR,"approved"]
As you can see, the problem seems to be that the UPDATE is getting odd additional criteria in there, meaning it only gets applied if the modify user is the same, and the status hasn't changed.
The edit form is summoned using:
Sub EditChild() Dim sCurrentParent Dim objChild
sCurrentParent = uxChildren.GetCurrentField("CHILDID") Set objChild = Application.MainViews.Add("System:Add Edit Child", 0, False)
objChild.Caption = "Edit Child" objChild.SetDataMode 0, sCurrentParent objChild.CurrentID = sCurrentParent
If objChild.ShowModal = 1 Then 'okay was clicked End If
Set objBPCRequirement = Nothing End Sub
|