Hola
No hace falta que repitas toda la consulta cada vez, con añadir solo el orden es suficiente:
Código vb:
Ver originalstrSQL = "SELECT PrecioDetal * 1.12 AS PVP, tblProduct.CodRef, tblProduct.Descripcion, " & _
"tblProduct.Marca, tblExistencia.Existencia, tblProduct.IDUnidC , tblExistencia.Observaciones " & _
"FROM tblProduct " & _
"INNER JOIN tblExistencia ON tblProduct.CodRef = tblExistencia.CodRef " & _
"WHERE (Descripcion LIKE '%" & strDescripcion & "%' ) AND (Marca LIKE '%" & strMarca & "%') AND " & _
"(tblProduct.CodRef LIKE '%" & strCodigo & "%') AND (Observaciones LIKE '%" & strReferencia & "%') " & _
"AND ((PrecioDetal * 1.12) BETWEEN " & sngPVPdesde & " AND " & sngPVPhasta & ") "
"ORDER BY"
If OptCodigo.Value = True Then
strSQL = strSQL & " tblProduct.CodRef"
end if
If optDescripcicion.value=true then
strSQL = strSQL & " tblProduct.CodDes"
end if
...
--Saludos--