SELECT Coquest.questname, Coquest.questdesc, Coquest.questid; FROM sched!coquest; ORDER BY Coquest.questnameFor this view, the update criteria is key (QuestID) marked to update, questname,questdesc are marked to update and send SQL Updates is check.
SELECT Coprcque.*, Coquest.questdesc, Coquest.questname; FROM sched!coprcque INNER JOIN sched!coquest ; ON Coprcque.questid = Coquest.questid; WHERE Coprcque.procid = ?gnSelProcIDThe update key is coprcque.recordid and it is marked to update, coprcque.procid, coprcque.questID, coprcque.isrequired are marked to update, but coquest.questdesc and coquest.questname are NOT marked to update.
LOCAL lnCtr,lnCtr2,lcAlias,lnQuestID lcAlias=ALIAS() for lnCtr = 1 to thisform.pageframe1.page3.list1.ListCount if thisform.pageframe1.page3.list1.Selected(lnCtr) SELECT v_questions_all GOTO lnCtr lnQuestID=v_questions_all.questid lnProcID=coProc.procid * Check to see if this one is already in List1 SELECT questid FROM v_Questions_by_proc WHERE questID==lnQuestID INTO CURSOR xJunk IF _tally > 0 * It is already there ELSE SELECT v_questions_by_proc m.recordid=gnnext("COPRCQUE") m.procid=coProc.procid m.questid=lnQuestID m.isRequired=.f. m.QuestDesc=v_Questions_all.QuestDesc m.Questname=v_Questions_all.QuestName INSERT INTO v_questions_by_Proc FROM memvar IF CURSORGETPROP("Buffering")>1 =TABLEUPDATE(.t.,.t.,"v_questions_by_Proc") ENDIF IF USED("coprcque") SELECT coprcque IF CURSORGETPROP("Buffering")>1 =TABLEUPDATE(.t.,.t.,'coprcque') ENDIF ENDIF SELECT v_questions_by_proc =REQUERY("v_Questions_by_Proc") this.parent.Refresh() ENDIF endif endfor thisform.Refresh() SELECT coProcThe problem is that it inserts a record into the coprcque table like it is supposed to, but it also inserts a record into the coquest table (not supposed to).