Question : Two Inner Joins in One Query

I have a query that needs to refer to two inner joins.  I have it working with 1 inner join and but when I try to add the 2nd inner join it doesn't work...

My current query is as follows:

SELECT tblIncidentPeople.intIncidentID, tblIncidentPeople.intPeopleID, tblIncidentPeople.txtInvolvement, tblIncidents.intIncidentID, tblIncidents.txtNatureOfIncident, tblIncidents.memIncidentSummary, tblIncidents.datIncidentDate, tblIncidents.datIncidentTime, tblIncidents.datReportedDate, tblIncidents.datReportedTime, tblIncidents.datDateCreated, tblIncidents.booActive, tblIncidents.booReviewed, tblIncidents.booInvestigation, tblIncidents.booClosed, tblIncidents.booHPD, tblIncidents.intPrimaryInvestigator
FROM tblPeople INNER JOIN (tblIncidents INNER JOIN tblIncidentPeople ON tblIncidents.intIncidentID = tblIncidentPeople.intIncidentID) ON tblPeople.intPeopleID = tblIncidentPeople.intPeopleID
WHERE (((tblIncidentPeople.intPeopleID)=[Forms]![frmSpecificationByPersonInvolved].[txtPersonInvolved]));

BUT I need to add this inner join to the above query:

FROM tblIncidents INNER JOIN tblEmployee ON tblIncidents.intPrimaryInvestigator = tblEmployee.intEmployeeID

Can someone provide SQL correct syntax please.

Answer : Two Inner Joins in One Query

Hi,

You can asign the Display and Value Members of the combo and the datagrid will do the match for you as long the field asigned to the comboboxcolum have values of the datasource asigned, like this:

        Dim dgvc As DataGridViewComboBoxColumn
        dgvc = CType( dgvRO.Columns("cboItemNo"), DataGridViewComboBoxColumn)
        dgvc.DataSource = YOUDATASOURCE
        dgvc.DisplayMember = "THE FIELD YOU WANT TO DISPLAY"
        dgvc.ValueMember = "THE FIELD THAT MATCH IN BOTH TABLES"

This should be before you load you datagrid.

Hope it helps,
Random Solutions  
 
programming4us programming4us