=RECCOUNT(lcAlias) && from previous discussion on same theme for * refresh header of table APPEND BLANK IN (lcAlias) && lcAlias=alias of table to append * master with row-buffer =RECCOUNT(lcChildAlias) APPEND BLANK IN (lcChildAlias) &&alias of child table with table-buffer FLUSH && same try to refresh, same behaviour with or without thisform.Refresh()new code in child
=RECCOUNT(lcChildAlias)APPEND BLANK IN (lcChildAlias) &&alias of child table with table-buffer FLUSH && same try to refresh, same behaviour with or without thisform.Refresh()edit fields in textboxes and grid for child table with controlsource set to table fields
begin transaction lerror=(txnlevel()=0) if !lerror =reccount(ldatamaster) && same as above lerror=!tableupdate(.T.,.F.,ldatamaster) && ldatamaster = alias of master * table sele (ldatamaster) FLUSH if !lerror select (ldataslave) && ldataslave = alias of child table =reccount(ldataslave) lerror=!tableupdate(.T.,.F.,ldataslave) ENDIF if !lerror end transaction FLUSH sele (ldatamaster) GO (RECNO()) && refresh relations else thisform.lockscreen=.t. SET DELETED OFF IF TXNLEVEL()>0 ROLLBACK ENDIF SET DELETED ON thisform.refresh() thisform.lockscreen=.f. =aerror(laerror) thisform.error(laerror[1],laerror[2],lineno(1)) unlock all FLUSH endif endifthere are no errors so lerror=.f. all the time
procedure audit lparameters laction && 1 insert, 2 update, 3 delete private all lnOldArea = SELECT() if !used('audit') use audit in 0 again endif if type('oapp.name')='C' m.utilizator=oapp.utilizator && gets the user name else m.utilizator='NoOapp' endif m.timestamp=datetime() do case case laction=1 m.tip='Adaugare' && Add case laction=2 lnr=afields(acimp) for i=1 to lnr lcomm='m.'+acimp(i,1)+'=oldval(alias()+".'+acimp(i,1)+'",alias())' &lcomm && gets the old values from all fields endfor m.tip='Ac.val.old' && update old values type of record sele audit append blank gather memvar if CURSORGETPROP('BUFFERING','audit') > 1 =tableupdate(.t.) endif SELECT (lnOldArea) m.tip='Ac.val.nou' && update new values type of record case laction=3 m.tip='Stergere' && delete type of record endcase SELECT (lnOldArea) scatter memvar sele audit append blank gather memvar && new values of fields copyed in audit if CURSORGETPROP('BUFFERING','audit') > 1 =tableupdate(.t.) endif SELECT (lnOldArea) return .t.in next message I will send an extract of audit table