Do
findIncidenciaParteRg.EntireRow.Delete
Set findIncidenciaParteRg = wsIncidenciasParte.Range(RgIncidenciasParteAllIdparte).find(wsPartes.Cells(currRow, ColPartesIdparte), LookIn:=xlValues, LookAt:=xlWhole)
Loop While Not findIncidenciaParteRg Is Nothing
produces
Do
findIncidenciaParteRg.EntireRow.Delete
Set findIncidenciaParteRg = wsIncidenciasParte.Range(RgIncidenciasParteAllIdparte).find(wsPartes.Cells(currRow, ColPartesIdparte), LookIn:=xlValues, LookAt:=xlWhole)
Loop While Not findIncidenciaParteRg Is Nothing
so the end Loop is in wrong identation.
Also
query = "SELECT p.*, i.idincidencia, i.valor, m.descripcion, m.tipovalor FROM partes p" & _
" LEFT JOIN incidencias i ON i.idparte = p.idparte" & _
" LEFT JOIN masterincidencias m ON m.idincidencia = i.idincidencia"
produces
query = "SELECT p.*, i.idincidencia, i.valor, m.descripcion, m.tipovalor FROM partes p" & _
" LEFT JOIN incidencias i ON i.idparte = p.idparte" & _
" LEFT JOIN masterincidencias m ON m.idincidencia = i.idincidencia"
produces
so the end
Loop
is in wrong identation.Also
produces