Results 1 to 3 of 3

Thread: how to copy one field of the the table to the another field of another table?

  1. #1
    Join Date
    Feb 2012
    Posts
    1

    how to copy one field of the the table to the another field of another table?

    i have two tables
    1. location
    2. hardware

    in the location tables
    there is one field called USER the data type for user is text...

    in the same way in the hardware i need to add to add another field called user..this field gets updates and copy old user details from location..i'm using microsoft acccess 2010...

    please anyone help me

  2. #2
    Join Date
    Dec 2009
    Posts
    79
    You have not provided much in the way of detail regarding your table structures so I can't provide a precise query, but you would want to do something like
    Code:
    Dim sSQL As String
    sSQL = "UPDATE hardware "
    sSQL = sSQL & "INNER JOIN location ON location.user = hardware.user "
    sSQL = sSQL & "SET somefield = somevalvue "
    sSQL = sSQL & "WHERE somecondition = therightcondition";
    DoCmd.RunSQL sSQL

  3. #3
    Join Date
    May 2006
    Posts
    407
    antony1988, Are you trying to copy the value in "User" from the Location table into the field "User" in the Hardware table?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •