mohamad guntur

mohamad guntur

  • NA
  • 40
  • 40.7k

How to retrieve FK details from PK at another table in VB.NET

Oct 22 2012 12:07 AM
I got some issue when adding items in the form which contains FK from PK at another tables, so the data is related eah other.

PRODUCT            PURCHASE
-----------        -------------
ID_PRODUCT        ID_PURCHASE
NAME                 ID_PRODUCT
QTY                   DATE
PRICE                 QTY
                        TOTAL

I'm trying to manage. the frmPurchase.

1. The ID_PRODUCT from frmPurchase is using combobox so, the user can see the available PRODUCT are exists in database. and I also add the textbox txtNAME, txtQTY (which available in the PRODUCT table), and also the txtPRICE. After the user clicking the selected ID_PRODUCT at frmPurchase, the textbox automatically show the data from PRODUCT table

2. TOTAL from PURCHASE table got from QTY(PURCHASE table) * PRICE (PRODUCT table), how to use this formula in VB.NET

3. How to get the validation at VB.NET if the QTY on PURCHASE table higher than QTY on PRODUCT table?

thx in advance