Curso de Software de Ventas Parte 28, Ventana de Ventas Parte 3

programaresfacilCo

En este vídeo explico como buscar por la identificación del Cliente en el vídeo anterior Ventana de Ventas Parte 2 explique como buscar el cliente desde el botón Buscar.

Colabora y Suscribete a mi canal de 

Para buscar el cliente por su identificación se debe captar cuando se presione la tecla Enter en el evento KeyUp de control TextBox, el código es el siguiente:

Private Sub txtIdentificacion_Cli_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
       Call BuscarClienteIdentificacion
    End If
End Sub

Ahora toca crear el Sub Procedimiento BuscarClienteIdentificacion que se esta llamando desde el evento anterior:

Sub BuscarClienteIdentificacion()
    Dim RecordSet As New ADODB.RecordSet
    Dim Sql As String
    
    If txtIdentificacion_Cli.Text <> "" Then
    
        Sql = "Select IdCliente, NombreApellidos_cli, Identificacion_cli, Telefonos_cli, CupoAutorizado_cli From tblClientes Where Identificacion_cli = '" & txtIdentificacion_Cli.Text & "' "
        Set RecordSet = ConexionADO.Execute(Sql)
        
        If RecordSet.RecordCount > 0 Then
           With RecordSet
                Call SeleccionarCliente(!IdCliente, !Identificacion_cli, !NombreApellidos_cli, !Telefonos_cli, !CupoAutorizado_cli)
           End With
        Else
           MsgBox "El Cliente no existe", vbExclamation, "Buscar Cliente"
           txtIdentificacion_Cli.SetFocus
        End If
    End If
    
End Sub

Apóyanos siguiendo las redes sociales:

Suscribete a Youtube

Siguenos en Twitter

Siguenos en Facebook

Total Page Visits: 6210 - Today Page Visits: 5

Deja una respuesta