Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding you rown unique ID to a query

Status
Not open for further replies.

arobbo

IS-IT--Management
Feb 15, 2005
62
GB
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];
 
why not add hidden text fields to the form and then you can use those as the criteria?

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top