thisform.updatelist(nRowIndex,nColumnIndex,bonPicture,this,'co_pat_ID','pat_ID_ID')I simply have to modify the last two values for each activeX.
PARAMETERS nRow,nCol,bonPicture,oObjectName,ctable,cfield IF nCol=2 AND bonPicture lnID=VAL(oObjectName.LISTITEM(nRow,3).Text) IF allt(oObjectName.LISTITEM(nRow,2).Text)='1' *----------------------------------------------------------------------------------------------* * Record is set to true, change to false *----------------------------------------------------------------------------------------------* oObjectName.LISTITEM(nRow,2).Text='0' lnID=VAL(oObjectName.LISTITEM(nRow,3).Text) lcCmd=[Update ]+ALLTRIM(cTable)+[ set answerflag = 0 where ]+cField+[ =?lnID] IF SQLEXEC(gnConnHandle,lcCmd)<1 =sqlerror() endif ELSE *----------------------------------------------------------------------------------------------* * Record is set to false, change to true *----------------------------------------------------------------------------------------------* oObjectName.LISTITEM(nRow,2).Text='1' lnID=VAL(oObjectName.LISTITEM(nRow,3).Text) lnRecordID=VAL(oObjectName.LISTITEM(nRow,4).Text) *----------------------------------------------------------------------------------------------* * Check to see if we have had a record here already, if so, we update, otherwise we insert *----------------------------------------------------------------------------------------------* IF lnID=0 lnRecordID=VAL(oObjectName.LISTITEM(nRow,4).Text) * Insert New Record Into Table lcCmd=[Insert into ]+cTable+[ (meetingnumber,recordid,answerflag) values (?gnMeetID,?lnRecordID,1) ] IF SQLEXEC(gnConnHandle,lcCmd)<1 =sqlerror() ELSE *----------------------------------------------------------------------------------------------* * We need to get the Need ID that was assigned in case the user unclicks this record *----------------------------------------------------------------------------------------------* IF SQLEXEC(gnConnHandle,[select @@Identity as xNewID]) < 1 =sqlerror() ELSE oObjectName.LISTITEM(nRow,3).Text=ALLTRIM(STR(sqlresult.xNewID)) ENDIF ENDIF ELSE lcCmd=[Update ]+cTable+[ set answerflag = 1 where ]+cfield+[ =?lnID] IF SQLEXEC(gnConnHandle,lcCmd)<1 =sqlerror() ENDIF ENDIF ENDIF oObjectName.listitem(nRow,2).pictureindex=IIF(ALLTRIM(oObjectName.LISTITEM(nRow,2).Text)='0',15,16) ENDIFThis all works great on the first page. The question is how to I call reference the object for page 2 and 3 since they are an object also? Here is how I create the object for the second page:
SET CLASSLIB TO tenca addi thisform.LockScreen=.t. if !type("this.page2o")="O" this.NewObject("page2o","tenca_page2_io") this.Page2O.visible = .t. endif thisform.LockScreen=.f.Thanks for any pointers