Hello.
My base had 4 tables :
T_CUSTOMERS
CUS_ID
CUS_LAST_NAME
CUS_FIRST_NAME
T_INVOICES
INV_ID
INV_DATE
CUS_ID
INV_VAT_RATE
T_INVOICES_SUB
INV_ID
PRO_ID
INV_UPET
INV_QTY
T_PRODUCTS
PRO_ID
PRO_LABEL
PRO_UPET
I have a form called F_INVOICES. Within, the main form is frmInvoices and the subform is frmInvoicesSub. In this subform, I have a griddata called grdInvoicesSub (its table is T_INVOICES_SUB).
I have a listbox called lstProId for the column PRO_ID of the T_PRODUCTS table for select a product, with this in SQL mode :
SELECT “PRO_LABEL” || ’ ’ ||
“PRO_UPET” , “PRO_ID” FROM
“T_PRODUCTS”
I’m seaching a macro for after selection of product and update of the lstProId listbox, I would like the PRO_UPET field of T_PRODUCTS to be copied in the INV_UPET field of the T_INVOICES_SUB field.
Important : PRO_UPET and INV_UPET must remain independent ; a subsequent change of the price in T_PRODUCTS table must not be reflected in the invoices already entered in T_INVOICES_SUB table. A JOIN type request is therefore not adapted.
Thanks.