Hi, I have a very basic problem. I have a database.mdb in my program and I want to know how to have the user enter data into two tables, then select a field from each table and perform some math function....lets say.. add the two fields together. I cannot figure out how to retrieve data from particular fields of each table........
Thanks
Andy
A good example of what I want to be able to do would be to think of buying scrap metals. I want to have one table that has alot of different prices per pound of different kinds of metal so the user needs to be able to select the kind of metal then... another table that has alot of weights so the user picks one, then somewhere on the screen it should show the product of the weight and price per pound.

Database
robinjam
I can't tell for sure if you're trying to calculate the product while retrieving the information from the database (like in the SELECT statement) or within the processing of the form itself (after the data has been retrieved). In general, the SELECT statement would have an INNER JOIN between the products and the weights table and then the fields could be included in the SELECT by way of the following:
SELECT product.price * weight.price as ExtendedValue FROM product INNER JOIN weight on product.weightcode = weight.weightcode
If you're trying to do the calculation in a Windows Form application, then you would need to write an event handler for the Changed event on the two fields and redo the calculation on the fly.
Let me know if I a long ways off base here :)
Dietz