>=CURSORSETPROP("Buffering", 2, "Carrier") >>
>IF !EMPTY(CARRIER.ca_sysnum) > tempsysnum = CARRIER.ca_sysnum >ELSE > tempsysnum = 0 >ENDIF >*--On a new record tempsysnum = 0 that is where the problems begin >IF tempsysnum = 0 > tempsysnum = sys_num("CARRIER") && returns a value as it should i.e. 86 > *--Here I tried storing it to a hidden control on the form that the > *--the user cannot see to verify that the value exists as it should > *--the control below has its controlsource set to carrier.ca_sysnum > this.parent.txtsysnum.value=tempsysnum && this changes as it should > *--I now can verify that tempsysnum = 86 and the control above > *--equals 86 too as it should >ENDIF >SELE CARRIER >IF TABLEUPDATE(0, .T., 'CARRIER') && runs ok > *--do more stuff which all works correctly as it should >ENDIF >*--Now all values are saved to the table EXCEPT the carrier.ca_synum >>
> > IF carrier.ca_sysnum = 0 .OR. EMPTY(carrier.ca_sysnum) > tempsysnum = 0 > tempsysnum = sys_num("CARRIER") > IF USED('CARRIERA') .and. !EOF('CARRIERA') > IF tempsysnum > 0 > REPLACE CARRIERA.ca_sysnum WITH tempsysnum > REPLACE CARRIER.ca_sysnum WITH tempsysnum > ENDIF > ELSE > IF tempsysnum > 0 > REPLACE CARRIER.ca_sysnum WITH tempsysnum > ENDIF > ENDIF > ENDIF >*--Table update occurs here >>Just before the tableupdate but it was not working. If i check the value of
REPLACE CARRIERA.ca_sysnum WITH tempsysnum REPLACE CARRIER.ca_sysnum WITH tempsysnumwith
REPLACE CARRIERA.ca_sysnum WITH tempsysnum in CARRIERA REPLACE CARRIER.ca_sysnum WITH tempsysnum in CARRIERAnd also check that CARRIER is not in the EOF()