Hi i've got a simple query that pulls data from two tables and displays the Distinct() manufacturer_names , date_from and Date_To
i'm using this to populate a list box but i want to use all three fields in a calculation on a further form. I was thinking if i could add a field from the query that was a unique ID that could be the value that is displayed from the list box and then the calculation can then refer that number to the query to get the data i need.
Any ideas how i can add this unique ID to my query, currently my query is as follows
SELECT DISTINCT ([manufacturer].[Manufacturer_Name]), [purchase_returns_period].[purchase_returns_Date_From], [purchase_returns_period].[purchase_returns_Date_to]
FROM purchase_returns_period INNER JOIN (manufacturer INNER JOIN purchase_returns ON [manufacturer].[manufacturer_ID]=[purchase_returns].[manufacturer_ID]) ON [purchase_returns_period].[purchase_returns_period_ID]=[purchase_returns].[Purchase_Returns_period_ID];
i'm using this to populate a list box but i want to use all three fields in a calculation on a further form. I was thinking if i could add a field from the query that was a unique ID that could be the value that is displayed from the list box and then the calculation can then refer that number to the query to get the data i need.
Any ideas how i can add this unique ID to my query, currently my query is as follows
SELECT DISTINCT ([manufacturer].[Manufacturer_Name]), [purchase_returns_period].[purchase_returns_Date_From], [purchase_returns_period].[purchase_returns_Date_to]
FROM purchase_returns_period INNER JOIN (manufacturer INNER JOIN purchase_returns ON [manufacturer].[manufacturer_ID]=[purchase_returns].[manufacturer_ID]) ON [purchase_returns_period].[purchase_returns_period_ID]=[purchase_returns].[Purchase_Returns_period_ID];