updating a field in a table

aymanmb

Registered User.
Local time
Today, 14:38
Joined
Jan 28, 2007
Messages
96
Dear all,

I have a simple database with few tables for which I created forms for the user to enter data.

I craeted in one ofthe forms a ombobox that reads from a table (list of suppliers fro example). I want the user to be able to select a supplier name and then this selected name will be fed to another table (order form for example). I did all requested work as I could understand bi\ut the end results is that it writes only the corresoponding ID number (e.g. 3) of the supplier and the supplier name itself (text).

Am I doing something wrong or missing a code?

appreciate helping a newbie

regards
 
That's the way relational databases work. Storing the ID is the correct way of doing it. If you want to show the name, use a query to join to the supplier table.
 
What he's saying is, your structure is right.

Code:
[B]SupplierTable[/B]

[U]SupplierID[/U]   [U]SupplierName[/U]
1            Supplier1
2            Supplier2
3            Supplier3
.            .
X            SupplierX

[B]OrderTable[/B]

[U]OrderID[/U]      [U]SupplierID[/U]   [U]OrderDetails[/U]
1            1            Some_detail_field_here
2            1            " "
3            2            " "
.            .            .
X            X            X

The above is right (albeit simplied). To get the Supplier's Name to say put it on an invoice, a very easy wasy is with a DLookUp, like so:

Code:
Supplier_Name_Field = DLookUp("[SupplierName]","SupplierTable",[SupplierID]=" & SupplierIDField)
 

Users who are viewing this thread

Back
Top Bottom