none
How to pull the field value of one table in another table in access 2010

    Question

  • 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.

     

    Thanks,

    siddiqali.


    Mohammad Siddiqali
    Tuesday, November 02, 2010 4:13 AM

All replies

  • Hi,

    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

    FROM Table1;

    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:

    http://www.ehow.com/how_2020507_values-insert-access.html

    Note: it is for Access 2003, but the steps are similar in Access 2010.

    Hope that helps.

    Friday, November 05, 2010 6:59 AM
  • 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

     

    Thank you,

    siddiqali.

     

     

     


    Mohammad Siddiqali
    Tuesday, November 09, 2010 4:51 AM