dackedyman
New member
- Local time
- Today, 04:31
- Joined
- Aug 3, 2019
- Messages
- 9
I have seen a few threads on this issue online, but they are confusing to me.
I work for a medical company with Therapist, and I have been able to display who specializes in a certain area based of a combo box selection. However, I want to further filter/narrow the search results based off the model that the therapist uses. It is not so important to understand what Model means, but I want to use two combo boxes to narrow the search results to show the user which Therapist have a certain combination of Specialty and Model.
I have created a UNION query to combine the Specialties and Models that the Therapist use. However, I do not know how to implement this SQL in VBA so that the user can first select by Specialty and get certain results and then to further narrow those results based off the model that the user selects.
This is the VBA that I have so far for the Specialty that the user can use to find out who Specializes in a certain area:
Any help would be greatly appreciated. Thank you.
I work for a medical company with Therapist, and I have been able to display who specializes in a certain area based of a combo box selection. However, I want to further filter/narrow the search results based off the model that the therapist uses. It is not so important to understand what Model means, but I want to use two combo boxes to narrow the search results to show the user which Therapist have a certain combination of Specialty and Model.
I have created a UNION query to combine the Specialties and Models that the Therapist use. However, I do not know how to implement this SQL in VBA so that the user can first select by Specialty and get certain results and then to further narrow those results based off the model that the user selects.
This is the VBA that I have so far for the Specialty that the user can use to find out who Specializes in a certain area:
Code:
List6.RowSource = "SELECT tblStaff.StaffID, tblStaff.FirstName AS [First Name], tblStaff.LastName AS [Last Name], tblStaff.Position, tblSpecialities.Type " & _
"FROM (tblStaff INNER JOIN StaffSpecialitiesJunctionTbl ON tblStaff.StaffID = StaffSpecialitiesJunctionTbl.StaffID) " & _
"INNER JOIN tblSpecialities ON StaffSpecialitiesJunctionTbl.SpecialitiesID = tblSpecialities.SpecialitiesID " & _
"WHERE tblSpecialities.Type = Forms![SpecialitySearch]![Combo10]" & " " & _
"ORDER BY tblStaff.LastName, tblStaff.FirstName;"
Any help would be greatly appreciated. Thank you.
Last edited by a moderator: