Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Not Being Saved
Message
 
To
30/01/2004 17:19:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00872558
Message ID:
00872581
Views:
16
>I have a form with buffering set to 2 in the load of the form:
>
>
>=CURSORSETPROP("Buffering", 2, "Carrier")
>
>
>The table has 10 fields but only 9 are shown on the form. The 10th field is a system id number that is generated behind the scenes and stored manually.
>
>The 10th field (system id number) is the only field not storing. Troubleshooting this, I tried the below code as a test:
>
>
>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
>
>
>Any idea why?
>
>Originally, I was doing this:
>
>
>
>	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
>carrier.ca_sysnum it is still 0. It steps through that line but it doesn't actually change the value.
>
>Right now the only values actually changing in the table are those that have
>a control on the form that the user actually enters and inputs a value into.
>
>I'm missing something, but what?

Not sure about the first part, but the I would change
REPLACE CARRIERA.ca_sysnum WITH tempsysnum
REPLACE CARRIER.ca_sysnum WITH tempsysnum
with
REPLACE CARRIERA.ca_sysnum WITH tempsysnum in CARRIERA
REPLACE CARRIER.ca_sysnum WITH tempsysnum in CARRIER
And also check that CARRIER is not in the EOF()

HTH
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform