
04/03/2005, 11:39
|
 | Colaborador | | Fecha de Ingreso: diciembre-2003 Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 21 años, 4 meses Puntos: 53 | |
bueno yo lo tengo algo asi..
Código:
Private Sub Form_Load()
Set Cxn = New Connection
Cxn.CursorLocation = adUseClient
Cxn.Open CxnFac ' Aqui la definicion de la conexion que usas..
Cargar_Clientes
End Sub
Private Sub Cargar_Clientes()
Dim AdoP As New Recordset
Set AdoP = New Recordset
AdoP.Open "SELECT `clientes`.`nit_cliente`, `clientes`.`nombre` FROM `clientes` WHERE (`clientes`.`cliente` <> 0)", Cxn, adOpenStatic, adLockOptimistic
Set CboCliente.DataSource = AdoP
Set CboCliente.RowSource = AdoP
CboCliente.BoundColumn = "nit_cliente"
CboCliente.ListField = "nombre"
End Sub
Private Sub CboCliente_Change()
If CboCliente.Text <> "" Then
CboFactura.Text = ""
Clean
Buscar_Facs (CboCliente.BoundText)
End If
End Sub
Function Buscar_Facs(Nit As String)
Dim AdoS As New Recordset
Set AdoS = New Recordset
AdoS.Open "SELECT `cxc`.`no_factura`, `cxc`.`nit_cliente`, `cxc`.`no_ingreso`, `cxc`.`fecha`, `cxc`.`total`, `cxc`.`descripcion`, `cxc`.`observaciones`, `cxc`.`cancelado` FROM `cxc` WHERE (`cxc`.`cancelado` = 0) AND (`cxc`.`nit_cliente` = '" & Nit & "') ORDER BY `cxc`.`fecha`", Cxn, adOpenStatic, adLockOptimistic
Set CboFactura.DataSource = AdoS
Set CboFactura.RowSource = AdoS
CboFactura.BoundColumn = "no_factura"
CboFactura.ListField = "no_factura"
If AdoS.RecordCount > 0 Then
CboFactura.Enabled = True
CmdIrFac.Enabled = True
Else
CboFactura.Enabled = False
CmdIrFac.Enabled = False
End If
End Function
espero te sirva el ejemplo..
nos vemos..
__________________ * Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila |