Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manipulating data with objects
Message
From
21/07/2000 10:09:56
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Manipulating data with objects
Miscellaneous
Thread ID:
00395398
Message ID:
00395398
Views:
53
I have a feeling I'm about to learn something.

I have a form with a view in the D.E.

This is the code on load:

SET PATH TO ('C:\DiamondAcct\Data\')
OPEN DATABASE Tomparco SHARED
SET EXCLUSIVE OFF
DBSETPROP('intrancust', 'view', 'Tables', 'Tomparco!inventory')
DBSETPROP('intrancust', 'view', 'SendUpdates',.F.)
=CURSORSETPROP("Buffering", 3, "intrancust")
INDEX ON stocknum TAG stocknum

On the form is a combobox we'll call C1 and a textbox we'll call T1. C1's rowsource is a field of the view called stocknum. T1's visible property is set to .F. and its ControlSource is the same field stocknum.

Another item on the form is an append button. When pressed, C1's visible property goes to .F., and T1's goes to .T. so that new data can be entered. This is the procedure in the click event:

Thisform.C1.Visible = .F.
Thisform.T1.Visible = .T.
clear
ThisForm.Text1.value = ""
DBSETPROP('intrancust', 'view', 'Tables', 'Tomparco!inventory')
DBSETPROP('intrancust', 'view', 'SendUpdates',.T.)
APPEND BLANK

I now enter data into T1 and press the save button, which runs this:

REPLACE stocknum WITH Thisform.T1.value
=TableUpdate(.T.)

If I now close the form and browse my the table it wrote to (through the view), the new row of data was added beautifully, but whatever data that was showing in C1 before the append has been erased (For example if the data in C1 was "BR-549", then "BR-549" is now a blank field of whatever record it was the stocknum for).

I'm not really clear on what's happening nor what to do about it. If someone would enlighten me, I would be greatly endebted.

Thanks
JD
Next
Reply
Map
View

Click here to load this message in the networking platform