David Redden
David Redden

Reputation: 147

Combine List as field value in another list

I know I am supposed to have some kind of an idea or start to post on here for assitance; however, I am completely lost if there is a way/method to do this. I am looking to do this in either MS Access or SQL with a MS Access User Interface. I am provided a table with fields such as the below. The Customer_Code is left blank. I am then provided a list of Customer_Code(s): could be 1, could be a lot. I need to automate populating List1, Field Customer_Code from List2

LIST 1 - Current state

 Record Type    Customer_Code     Product          Label_ID     Label_Desc      Product_Desc
 ABC                              Product 1        3            Short_Desc      Long Desc
 ABC                              Product 2        3            Short_Desc      Long Desc
 ABC                              Product 3        3            Short_Desc      Long Desc
 ABC                              Product 4        3            Short_Desc      Long Desc

LIST2

 Customer_Code
 12345GR
 78901ZX
 54321RG
 10987XZ

FUTURE / DESIRED STATE

 Record Type    Customer_Code     Product          Label_ID     Label_Desc      Product_Desc
 ABC            12345GR           Product 1        3            Short_Desc      Long Desc
 ABC            12345GR           Product 2        3            Short_Desc      Long Desc
 ABC            12345GR           Product 3        3            Short_Desc      Long Desc
 ABC            12345GR           Product 4        3            Short_Desc      Long Desc
 ABC            78901ZX           Product 1        3            Short_Desc      Long Desc
 ABC            78901ZX           Product 2        3            Short_Desc      Long Desc
 ABC            78901ZX           Product 3        3            Short_Desc      Long Desc
 ABC            78901ZX           Product 4        3            Short_Desc      Long Desc
 ABC            54321RG           Product 1        3            Short_Desc      Long Desc
 ABC            54321RG           Product 2        3            Short_Desc      Long Desc
 ABC            54321RG           Product 3        3            Short_Desc      Long Desc
 ABC            54321RG           Product 4        3            Short_Desc      Long Desc
 ABC            10987XZ           Product 1        3            Short_Desc      Long Desc
 ABC            10987XZ           Product 2        3            Short_Desc      Long Desc
 ABC            10987XZ           Product 3        3            Short_Desc      Long Desc
 ABC            10987XZ           Product 4        3            Short_Desc      Long Desc

So far all I have is a simple query
UPDATE [List1], [Customer_Code] SET [List1].[Customer_Code] = [List2]. [Customer_Code];

Upvotes: 0

Views: 51

Answers (1)

David Redden
David Redden

Reputation: 147

Marciej answered my question. It was very simple; I was overthinking this one: SImple Select query:

SELECT t1.*, t2.* FROM List1 As t1, List2 as t2

Upvotes: 1

Related Questions