Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Strangely behaving view during tableupdate
I've been puzzled by this one for a while...
I have a form based on 12 views, 6 of which are updatable.
1 - Order info
4 - Address info (residence, employer, education, licensing)
1 - Order Items (table - OrderItems) (view - vpOrderItems_Order_ID)
The first five update fine. OrderItems gives me a mixture of correct and incorrect results. All fields are stored correctly, except the Sup_ID, Report_Num, and Report_ID. These store info from one record (from vpOrderItems_Order_ID) into each record (of the same order_id) in the OrderItems table. The information is correct, on the individual records in the view. And the rest of the fields go over correctly.
The vpOrderItems_Order_ID view is filled from a Grid which contains 2 Combo boxes (Report Name and State).
(...if there's a better way...)
In the valid of the ReportName ComboBox I do the following:
--------------------------------------------
cSelect = SELECT()
SELECT vporderitems_order_id
REPLACE vporderitems_order_id.SUP_ID WITH VAL(This.List(This.ListItemID,3))
REPLACE vporderitems_order_id.Report_ID WITH VAL(This.List(This.ListItemID,4))
SELECT(cSelect)
--------------------------------------------
In the Grid's DoubleClick method I have the following:
--------------------------------------------
APPEND BLANK
REPLACE vpOrderItems_Order_ID.Order_ID WITH IIF( EMPTY(vpOrderItems_Order_ID.Order_ID), ThisForm.nOrder_ID, vpOrderItems_Order_ID.Order_ID)
REPLACE vpOrderItems_Order_ID.Report_Num WITH IIF( EMPTY(vpOrderItems_Order_ID.Report_Num), ALLTRIM(ThisForm.cOrder_ID)+"-"+PADL(ALLTRIM(STR(RECCOUNT())),2,"0"), vpOrderItems_Order_ID.Report_Num)
REPLACE vpOrderItems_Order_ID.Country WITH IIF( EMPTY(vpOrderItems_Order_ID.Country), "USA", vpOrderItems_Order_ID.Country)
REPLACE vpOrderItems_Order_ID.Status WITH IIF( EMPTY(vpOrderItems_Order_ID.Closed), "Not Complete - Last Modified: "+TTOC(DATETIME())+" "+THISFORM.User_ID, vpOrderItems_Order_ID.Status + CHR(13) + "Not Complete - Last Modified: "+TTOC(DATETIME())+" "+THISFORM.User_ID)
REPLACE vpOrderItems_Order_ID.USER_ID WITH IIF( EMPTY(vpOrderItems_Order_ID.USER_ID) , THISFORM.User_ID, vpOrderItems_Order_ID.USER_ID)
--------------------------------------------
In the Grid's AfterRowColChange method I have the following::
--------------------------------------------
LPARAMETERS nColIndex
REPLACE vpOrderItems_Order_ID.Order_ID WITH IIF( EMPTY(vpOrderItems_Order_ID.Order_ID), ThisForm.nOrder_ID, vpOrderItems_Order_ID.Order_ID)
REPLACE vpOrderItems_Order_ID.Report_Num WITH IIF( EMPTY(vpOrderItems_Order_ID.Report_Num), ALLTRIM(ThisForm.cOrder_ID)+"-"+PADL(ALLTRIM(STR(RECCOUNT())),2,"0"), vpOrderItems_Order_ID.Report_Num)
REPLACE vpOrderItems_Order_ID.Country WITH IIF( EMPTY(vpOrderItems_Order_ID.Country), "USA", vpOrderItems_Order_ID.Country)
REPLACE vpOrderItems_Order_ID.Status WITH IIF( EMPTY(vpOrderItems_Order_ID.Closed), "Not Complete - Last Modified: "+TTOC(DATETIME())+" "+THISFORM.User_ID, vpOrderItems_Order_ID.Status + CHR(13) + "Not Complete - Last Modified: "+TTOC(DATETIME())+" "+THISFORM.User_ID)
REPLACE vpOrderItems_Order_ID.USER_ID WITH IIF( EMPTY(vpOrderItems_Order_ID.USER_ID) , THISFORM.User_ID, vpOrderItems_Order_ID.USER_ID)
SET MESSAGE TO
DODEFAULT()
--------------------------------------------
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement