Results 1 to 2 of 2
  1. #1
    TastyOs is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Posts
    2

    Question Using Queries to fill in a field??

    Hey guys, I'm new to the forum. I have a question and I'm not sure the best way too go about it. Pretty much I have 2 tables...

    Table 1



    a x
    a x
    a x
    a x
    b y
    b y
    b y
    b y

    Table 2
    a x
    b y

    In table 1 there's additional fields that make each record unique, but as you can see, the first two fields in Table 1 have a lot of repetition. Table 2 is completely unique. Is there a good way to take info from field 1 of table 1, look at table 2, see where field 1 of table 1 is identical to field 1 of table 2, and take the data from field 2 of table 2 and put it into field 2 of table 1? I don't if I'm describing the situation well, but any help would be appreciated!

    Thanks!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum!

    You are pretty vague..... but there are several ways to proceed.

    If this is a one time event, use an update query, something like
    Code:
    UPDATE table1 SET table1.field2 = table2.field2
    WHERE table2.field1=field1.field1;
    If you are entering data in a form and there are combo boxes/list boxes, use the after update event with some VBA code to update table1.field 2.
    If the control is a text box, the after update event might work for you.
    I would use a PK/Fk relationship and not store duplicate data.

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

Similar Threads

  1. Fill in Field base on Value of Another
    By Njliven in forum Forms
    Replies: 3
    Last Post: 03-30-2015, 07:13 AM
  2. Replies: 2
    Last Post: 11-30-2014, 07:52 AM
  3. Replies: 10
    Last Post: 11-21-2011, 02:56 AM
  4. Replies: 5
    Last Post: 01-20-2011, 11:36 PM
  5. Replies: 2
    Last Post: 09-20-2010, 09:02 PM

Tags for this Thread

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