Hello everybody,
Can anybody help with this...
I have the following code:
The result of the queury is a list fo unique values but by including the "count" function in SQL seems not te be working in combination with "DISTINCT"
Many thanks for all your help,
Kindly Regards,
Koen
Can anybody help with this...
I have the following code:
Code:
Dim rs As DAO.Recordset
Dim db As Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT DISTINCT tbl_contract_lev.ContractID FROM (tbl_leverancier_gegevens INNER JOIN tbl_contract_lev ON tbl_leverancier_gegevens.Id_lev = tbl_contract_lev.LeverancierID) INNER JOIN tbl_data_leverancier ON tbl_contract_lev.ContractID = tbl_data_leverancier.ContractID"
Set rs = db.OpenRecordset(strSQL)
RecordCount = rs.Fields(0)
rs.Close
Set rs = Nothing
Set db = Nothing
strTitle = "FINISH !!!"
MsgBox RecordCount, vbOKOnly + vbInformation, strTitle
Many thanks for all your help,
Kindly Regards,
Koen