Right ive been looking around for a solution for this most of last night and today and i havent found anything that can help :(
I have a table called Intake_Hopper which has the field names "Product_Desciption" and "Product_Code" what im trying to find out is how do i autopopluate "Product_Desciption" when the user types in a Product Code
Both of these are help in the "Products" table
Im not doing this in a form as i have a vb front end so i only want this to happen when the user goes into the raw database and enters data.
I hope this makes sence :)
If I am reading you correctly then you should have
no need to autopopulate it in vb code if you have a properly normalised structure. (
which you have... you store products in their own table)
You only need populate Product_Code in the Intake_Hopper table because you would then... in the case of any data retrieval... be LEFT joining in SQL with the Products table and including the Description field as a column in any output. This will '
at that point' automatically return the description in any retrieved recordset.
As it is, if you continued as is, you would be creating static standalone
'product description' data in the intake hopper table that would have no integrity or bearing with the products table description. ie
IF someone were to change the 'product description' in table products you would have unsynchronised data in 'Product_Description field of table Intake_Hopper.
Here is the SQL syntax to reflect what I mean where it would autopopulate on data retrieval.
-
-
SELECT Intake_Hopper.Product_Code, Products.Description, Intake_Hopper.NextField1,Intake_Hopper.NextField2
-
FROM Intake_Hopper
-
LEFT JOIN Products ON Intake_Hopper.Product_Code = Intake_Hopper.Product_Code;
-
-
Regards
Jim :)