Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Not Being Saved
Message
From
30/01/2004 17:19:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Data Not Being Saved
Miscellaneous
Thread ID:
00872558
Message ID:
00872558
Views:
46
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?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform