Results 1 to 3 of 3
  1. #1
    PSOSSA is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2015
    Posts
    2

    Update Field When Another Field Changes

    I'm trying to set up a form to automatically populate certain fields when a user chooses a selection from a drop-down list. I know I have to use the AfterUpdate command, and I have found several different 'solutions' for this on the web, but nothing is working for me.

    Layout is like this:
    Table1.Column2 has an entry of 'ABC123'.
    Table2.Column2 is blank.

    I want to update Table2.Column2 with the value of Table1.Column2.



    I have tried:
    UPDATE Table2
    SET Table2.Column2 = (SELECT Table1.Column2 From Table1 WHERE Table1.Column3 = Table2.Column3)


    UPDATE Table2
    INNER JOIN Table1 ON Table2.Column3 = Table1.Column3
    SET Table2.Column2 = Table1.Column2
    WHERE Table1.Column3 = Table2.Column3

    In both cases, the query comes back blank.

    Your help is appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why are you duplicating data into another table?

    Don't need the WHERE clause, although don't think it is the issue and the second query should work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    PSOSSA is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2015
    Posts
    2
    I'm trying to tie several tables together. The idea is table1, table2, and table3 each hold data exclusive to specific devices. The data is then correlated into table 4. Since users can choose any entry from table1, table2, and table3 I can't link them together before hand.

    And, I have just been told that everything I'm trying to do is moot because we actually have a product to do what I am trying to do. Oh well, it was a fun learning experience.

    Thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-30-2013, 12:11 PM
  2. Replies: 6
    Last Post: 04-26-2013, 10:07 AM
  3. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  4. Replies: 12
    Last Post: 03-17-2012, 04:46 AM
  5. Replies: 1
    Last Post: 08-31-2011, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums