Hello,
I have a strange problem that I would appreciate some help with. I have a query that is basically search a table with one linked table and I need to use the DISTINCT command as there is possibility of duplicate results. However as I understand it with the DISTINCT command you can only have the one field in the query SELECT, so I am ending up with a list of numbers (record key fields). Which is fine..
But I then need to use those ID numbers to get the actual data the user wants to see.
So I am wondering if I can take the results of the first query and pump them straight into another query and then showing results to user
Probably easy once you know how .. at least I hope so
My current query is being generated based on the users input ... but the bit that I think that is currently relevent is:
any help/direction would be great.
Thanks in advanced.
Graham.
I have a strange problem that I would appreciate some help with. I have a query that is basically search a table with one linked table and I need to use the DISTINCT command as there is possibility of duplicate results. However as I understand it with the DISTINCT command you can only have the one field in the query SELECT, so I am ending up with a list of numbers (record key fields). Which is fine..
But I then need to use those ID numbers to get the actual data the user wants to see.
So I am wondering if I can take the results of the first query and pump them straight into another query and then showing results to user
Probably easy once you know how .. at least I hope so
My current query is being generated based on the users input ... but the bit that I think that is currently relevent is:
Code:
'Concatenate the two SQL strings and then use.
CurrentDb.QueryDefs("flexQuery").SQL = "SELECT DISTINCT(address_book.pID) FROM address_book INNER JOIN prsn_interests_assoc ON prsn_interests_assoc.Persno=address_book.pID WHERE " & vWhere
DoCmd.OpenForm stDocName, , , vWhere
any help/direction would be great.
Thanks in advanced.
Graham.