How do I use a value from a table as criteria in a query? I created a MakeTable query and converted it to SQL. Then I copied the code multiple times to create the multiple tables - see below. I have a table with the vendor names. How can I get the vendor names from the vendor table so I can put this into a loop for all vendors in the table?
DoCmd.RunSQL "SELECT table_data.SKU, table_data.Price, table.Vendor INTO MT__1 " & vbCrLf & "FROM table_data " & vbCrLf & "WHERE (((table_data.Vendor)=""MyVendor1""));"
DoCmd.RunSQL "SELECT table_data.SKU, table_data.Price, table.Vendor INTO MT__2 " & vbCrLf & "FROM table_data " & vbCrLf & "WHERE (((table_data.Vendor)=""MyVendor2""));"
Thank you for your help!