Dear community,
FrameWork:
I have a table with the following fields: Id, Name, InterventionNumber, CheckPoint, Completed
In a form, I have a combobox that I want to populate with the entries that are obtained using the following criteria:
-First: check the maximum InterventionNumber for each unique Name;
-Second: filter the results of the first operation using the Completed field (it is a checkbox) equals True
Code Used:
Code:
Dim qry as String
qry = "Select Id, Name, Max(InterventionNumber) From [table]" & "Where Completed = True " & "Group by Id, Name"
Combobox.RowSource = qry
Problem:
Max function does not work because Id is always different (autonumber) despite the field "Name" possible repetitions.
Question:
How can I apply the filter just taking into account the Name and InterventionNumbers fields but being able to put all the fields that I want in the Combobox.
Thank you very much for your help.
Best regards,
Simão