In my Purch form, I have a subform POLines (a form of the POLines.db) . I want to add and manipulate data entry in this subform in Form View. But I would like to have a shadow subform (TVLines, which is also a form of the POLines.db) in tableview that only includes 5 fields of the POLines (ItemNum, ItemQty, ItemCost, ItemAvail, and ItemPlaced), so that the user can input/edit data in the Formview and have a nice summary in the TVLines subform of his progress on this PO.
I can get the TVLines subform to mirror the data in the POLines subform, but it won't hold the accumulated records as they are added in the POLines form.
Here is a screenshot of what happens ...
http://www.wordcom.com/POscreen8.htm (I supplied the text "blank" in two of the columns of the TVLines to indicate that these fields were blank)
And here is the code in POLines that adds a new record in POLines, and that I'm trying to have add a new record then in TVLines.
"AddNewLineItem":: On Element Entry
var vTemp as Int //this button will save the current LineItem record and then add a new record
var vTV as Int
var vItemNum as string
var vItemQty as double
var vItemCost as money
var vItemAvail as string
var vPlaced as boolean
// vItemNum = ItemNum
// vItemQty = ItemQty
// vItemCost = ItemCost
// vItemAvail = ItemAvail
// vPlaced = POLinesYN
If (@Mode() = 0) Or (@Mode() = 1)
{
vItemNum = @FormFieldValue("POLines","ItemNum", 0)
vItemQty = @FormFieldValue("POLines","ItemQty", 0)
vItemCost = @FormFieldValue("POLines","ItemCost", 0)
vItemAvail = @FormFieldValue("POLines","ItemAvail", 0)
vPlaced = @FormFieldValue("POLines","POLinesYN", 0)
FORMFIELDVALUE("TVPOLines","TVPOItemNum", 0, vItemNum)
FORMFIELDVALUE("TVPOLines","TVPOItemQty", 0, vItemQty)
FORMFIELDVALUE("TVPOLines","TVPOItemCost", 0, vItemCost)
FORMFIELDVALUE("TVPOLines","TVPOItemAvail", 0, vItemAvail)
FORMFIELDVALUE("TVPOLines","TVPOLinesYN", 0, vPlaced)
FormCommit("TVPOLines")
vTemp = @CreateNewRecord()
vTV = @FormNewRecord("TVPOLines")
ThrowFocus(ItemNum)
}
Suggestions?