Hi friends ,
I am working on access 2010 i have a problem on retrieving of a value form other table,I created Table1 having product name,cost and in Table2 i created quantity as a field and look-up product name from table 1 my task is if i select product name then how can i get the it's cost automatically from Table 1 to Table 2 i knew to create a look up but it doesn't look good .I hope you will respond to me.
- Moved by Richard Pennington - BPOS Support Wednesday, November 03, 2010 11:36 PM incorrect forums (From:Microsoft Online: Office Communications Online)
I'm not sure exactly what you are looking for. However if you have a dropdown box (cboTable1) with 2 fields from Table1 as follows:
SELECT ProductName, Cost
Then you can refer to those fields as follows:
Me.cboTable1 - will refer to the ProductName field assuming its the bound field
Me.cboTable1.Column(2) - will refer to the cost field
and so on.
However, inserting duplicate information from one table to another is not encourages in databases as it causes problems. I suggest you check out this tutorial first.
Also you can refer to this article about How to Look Up Values From One Table and Automatically Insert Them in Another Table in Access:
Note: it is for Access 2003, but the steps are similar in Access 2010.
Hope that helps.
Thank You Jennifer,
Taking your precious time and responding to me i,I am getting problem on retrieving data actually my task is .I have 2 tables one table contain ( "Product name" and "cost") in second table i have( product field which is a look-up from table1 and cost field ,quantity and total) .My task is when i select the product in second table i should get the selected product's from cost table one
I Hope you will respond to this reply