Programación General > Visual Basic 6.0 e inferiores
Error 94 En Tiempo De EjecuciÓn
(1/1)
mi69:
:unsure: hola a todos/as.
por favor, necesito ayuda con este código. si la consulta con encuentra registros, me aparece el error 94 en tiempo de ejecución. ya cambié el código varias veces, pero no puede solucionarlo...
gracias
datPrimaryRS.RecordSource = "Select Sum([Venta]) As Suma From MiTabla Where [Origen]='" & txtOrigen & "' AND [Destino]='" & txtDestino & "' AND [Venta]=" & txtVenta & " AND [Lugar]='" & txtLugar & "'"
datPrimaryRS.Refresh
If datPrimaryRS.Recordset.RecordCount > 0 Then
txtTotalVenta = datPrimaryRS.Recordset.Fields(0)
txtTotalVenta = Format(txtTotalVenta, "#,###,###,#0.00")
Else
txtTotalVenta = 0
txtTotalVenta = Format(txtTotalVenta, "#,###,###,#0.00")
End If
datPrimaryRS.RecordSource = "Select * From MiTabla Where [Origen]='" & txtOrigen & "' AND [Destino]='" & txtDestino & "' AND [Venta]=" & txtVenta & " AND [Lugar]='" & txtLugar & "'"
datPrimaryRS.Refresh
txtCantidadRegistros = datPrimaryRS.Recordset.RecordCount
grdDataGrid.Refresh
End Sub
ROBER.29:
El campo Origen, Destino, Venta y lugar son todos de tipo numéricos o de que tipo de datos son?
Sin esa información no podremo ayudarte a decir porque la consulta está mal.
Un saludo.
mi69:
hola, venta y lugar son númericos, los otros texto.
gracias :kicking:
Shiquilla:
--- Código: Text ---datPrimaryRS.RecordSource = "Select Sum([Venta]) As Suma From MiTabla Where [Origen]='" & txtOrigen & "' AND [Destino]='" & txtDestino & "' AND [Venta]=" & CDBL(txtVenta) & " AND [Lugar]=" & CDbl(txtLugar)
Saludos.
mi69:
gracias shiquilla :D
Navegación
Ir a la versión completa