adjunto el codigo donde consulto por la opcion seleccionada
Código:
Muchas gracias For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
SelEstac = delim & List1.Text & delim
strcondatos = "select estacion.id_estacion from estacion where estacion.nombre=" & SelEstac
rsDatos.Open strcondatos, conex
id = rsDatos!id_estacion
rsDatos.Close
strcondatos = "select count(*) as tot from caudal_medio where caudal_medio.id_estacion=" & id
rsDatos.Open strcondatos, conex
tot_medicion = rsDatos!tot
rsDatos.Close
strcondatos = "select count(*) as tot from caudal_medio where caudal_medio.id_estacion=" & id & "and caudal_medio.medicion=0"
rsDatos.Open strcondatos, conex
tot_ceros = rsDatos!tot
rsDatos.Close
res_diagn(id) = tot_ceros * 100 / tot_medicion
est = "Estacion "
dp = " : "
mensaje = est & id & dp & res_diagn(id) & "%"
MsgBox (mensaje)
End If
Next i

