amp-web-push-widget button.amp-subscribe { display: inline-flex; align-items: center; border-radius: 5px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 500; background: #4A90E2; margin-top: 7px; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .amp-logo amp-img{width:190px} .amp-menu input{display:none;}.amp-menu li.menu-item-has-children ul{display:none;}.amp-menu li{position:relative;display:block;}.amp-menu > li a{display:block;} /* Inline styles */ div.acss138d7{clear:both;}div.acssf5b84{--relposth-columns:3;--relposth-columns_m:2;--relposth-columns_t:2;}div.acss4b5cf{aspect-ratio:1/1;background:transparent url(https://www.programaresfacil.co/wp-content/uploads/2018/09/Curso-Software-Ventas-VB31-300x209.png) no-repeat scroll 0% 0%;height:300px;max-width:300px;}div.acss13836{color:#333333;font-family:Arial;font-size:14px;height:75px;}div.acss9c984{aspect-ratio:1/1;background:transparent url(https://www.programaresfacil.co/wp-content/uploads/2018/09/Curso-Software-Ventas-VB30-300x223.jpg) no-repeat scroll 0% 0%;height:300px;max-width:300px;}div.acssaa353{aspect-ratio:1/1;background:transparent url(https://www.programaresfacil.co/wp-content/uploads/2018/02/StatusBar-300x191.jpg) no-repeat scroll 0% 0%;height:300px;max-width:300px;}div.acss6f0f1{aspect-ratio:1/1;background:transparent url(https://www.programaresfacil.co/wp-content/uploads/2018/11/Tabla_Detalle_Venta-300x222.jpg) no-repeat scroll 0% 0%;height:300px;max-width:300px;}span.acss47fcd{background:#FFFFFF;color:#000000;}div.acss0f1bf{display:none;}a.acssf23c5{font-size:8pt;}a.acss24ea4{font-size:16.4pt;}a.acss066f0{font-size:22pt;} .ampforwp_wc_shortcode{margin-top: 0;padding:0;display:inline-block;width: 100%;} .ampforwp_wc_shortcode li{position: relative;width:29%; font-size:12px; line-height: 1; float: left;list-style-type: none;margin:2%;} .ampforwp_wc_shortcode .onsale{position: absolute;top: 0;right: 0;background: #ddd;padding: 7px;font-size: 12px;} .single-post .ampforwp_wc_shortcode li amp-img{margin:0} .ampforwp-wc-title{margin: 8px 0px 10px 0px;font-size: 13px;} .ampforwp-wc-price{color:#444} .wc_widgettitle{text-align:center;margin-bottom: 0px;} .ampforwp-wc-price, .ampforwp_wc_star_rating{float:left;margin-right: 10px;} .icon-widgets:before {content: "\e1bd";}.icon-search:before {content: "\e8b6";}.icon-shopping-cart:after {content: "\e8cc";} /******* Paste your Custom CSS in this Editor *******/
Continuando con el Curso de Software de Ventas, esta ves vamos a trabajar la ventana de Clientes, para Crear Modificar Clientes.
En este vídeo se creo el formulario de Clientes y de Buscar Cliente.
Los clientes son necesario a la hora de crear facturas a crédito, por eso es parte importante antes de entrar a la parte de ventas.
Procedimiento para Limpiar los campos del formulario:
Sub Limpiar() txtRazonS.Text = "" txtNitCliente.Text = "0" txtTelefonosCliente.Text = "0" txtDireccionCliente.Text = "-" txtCupo.Text = "0" chkFactVenciM.Value = 0 End Sub
Primero se trabajo la parte de Guardar Cliente, para esto se creo un procedimiento llamado Guardar Cliente:
Sub GuardarCliente() If txtRazonS.Text = "" Then MsgBox "Error - El Campo Nombre / Razón Social no puede estar vacío", vbExclamation, "Error" Exit Sub End If If txtNitCliente.Text = "" Then MsgBox "Error - El Campo Identifiación no puede estar vacío", vbExclamation, "Error" Exit Sub End If If txtTelefonosCliente.Text = "" Then MsgBox "Error - El Campo Teléfonos no puede estar vacío", vbExclamation, "Error" Exit Sub End If If txtDireccionCliente.Text = "" Then MsgBox "Error - El Campo Dirección no puede estar vacío", vbExclamation, "Error" Exit Sub End If If txtFechaCumple.Text = "" Then MsgBox "Error - El Campo Fecha de Nacimiento no puede estar vacío", vbExclamation, "Error" Exit Sub End If If IsDate(txtFechaCumple.Text) = False Then MsgBox "Error - El Campo Fecha de Nacimiento no tiene una fecha válida", vbExclamation, "Error" Exit Sub End If If txtEmail.Text = "" Then MsgBox "Error - El Campo Email no puede estar vacío", vbExclamation, "Error" Exit Sub End If If txtCupo.Text = "" Then MsgBox "Error - El Campo Cupo Autorizado no puede estar vacío", vbExclamation, "Error" Exit Sub End If If CodigoCliente = 0 Then IdCliente = UltimoIdTabla("tblClientes", "IdCliente") If chkFactVenciM.Value = 1 Then FacVec = "S" Else FacVec = "N" End If Sql = "Insert Into tblClientes (IdCliente, NombreApellidos_cli, Identificacion_cli, Telefonos_cli, Direccion_cli, Fecha_Naci_cli, Email_cli, CupoAutorizado_cli, FacturarVecidos) Values (" _ & IdCliente & ", '" & txtRazonS & "', '" & txtNitCliente & "', '" & txtTelefonosCliente & "', '" & txtDireccionCliente & "', '" & txtFechaCumple & "', '" & txtEmail & "', '" & txtCupo & "', '" & FacVec & "')" ConexionADO.Execute Sql MsgBox "Cliente Guardado", vbInformation, "Guardar" Else Sql = "Update tblClientes SET NombreApellidos_cli = '" & txtRazonS & "', Identificacion_cli = '" & txtNitCliente & "', Telefonos_cli = '" & txtTelefonosCliente & "', Direccion_cli = '" & txtDireccionCliente & "', Fecha_Naci_cli = '" & txtFechaCumple & "', Email_cli = '" & txtCupo & "', CupoAutorizado_cli = '" & txtCupo & "', FacturarVecidos = '" & FacVec & "' Where IdCliente = " & CodigoCliente ConexionADO.Execute Sql MsgBox "Cliente Actualizado", vbInformation, "Guardar" End If End Sub
Ya para la parte de Edición de Clientes, en otras palabras la modificación de Datos del Clientes primero se creo el procedimiento que carga los datos del cliente:
Dim CodigoCliente Sub LLenarDatosCliente() Dim RecorsetTemp As New ADODB.Recordset Sql = "Select * From tblClientes Where IdCliente = " & CodigoCliente Set RecorsetTemp = ConexionADO.Execute(Sql) If RecorsetTemp.RecordCount > 0 Then txtRazonS.Text = RecorsetTemp("NombreApellidos_cli") txtNitCliente = RecorsetTemp("Identificacion_cli") txtTelefonosCliente = RecorsetTemp("Telefonos_cli") txtDireccionCliente = RecorsetTemp("Direccion_cli") txtFechaCumple = RecorsetTemp("Fecha_Naci_cli") txtEmail = RecorsetTemp("Email_cli") txtCupo = RecorsetTemp("CupoAutorizado_cli") FacV = RecorsetTemp("FacturarVecidos") If FacV = "S" Then chkFactVenciM.Value = 1 Else chkFactVenciM.Value = 0 End If End If Call DesactivarCampos End Sub
Y se creo dos procedimiento para controlar la modificación de los clientes uno es para Desactivar los controles del formulario para que no se pueda modificar y el otro es para activarlos nuevamente:
Sub DesactivarCampos() txtRazonS.Enabled = False txtNitCliente.Enabled = False txtTelefonosCliente.Enabled = False txtDireccionCliente.Enabled = False txtFechaCumple.Enabled = False txtEmail.Enabled = False txtCupo.Enabled = False Me.chkFactVenciM.Enabled = False End Sub Sub ActivarCampos() txtRazonS.Enabled = True txtNitCliente.Enabled = True txtTelefonosCliente.Enabled = True txtDireccionCliente.Enabled = True txtFechaCumple.Enabled = True txtEmail.Enabled = True txtCupo.Enabled = True chkFactVenciM.Enabled = True End Sub
El Botón Nuevo del Formulario lleva el siguiente Código:
Private Sub cmdNuevo_Click() CodigoCliente = 0 Call Limpiar Call ActivarCampos End Sub
El botón guardar y el botón modificar:
Private Sub cmdGuardar_Click() Call GuardarCliente End Sub Private Sub cmdModificar_Click() Call ActivarCampos End Sub
El botón Nuevo:
Private Sub cmdNuevo_Click() CodigoCliente = 0 Call Limpiar Call ActivarCampos End Sub
El Evento Load del formulario:
Private Sub Form_Load() Call Limpiar If glob_ModificarCliente = True Then CodigoCliente = frmBuscarCliente.msGrid.TextMatrix(frmBuscarCliente.msGrid.Row, 1) Call LLenarDatosCliente Call DesactivarCampos Else Call ActivarCampos End If End Sub
Evento Unload del formulario necesario para modificar la variable que controla la edición del formulario:
Private Sub Form_Unload(Cancel As Integer) glob_ModificarCliente = False End Sub
En este proyecto, vamos a desarrollar una calculadora sencilla usando Visual Basic 6, que permite…
6 de septiembre de 2024 - La demanda de desarrolladores de software sigue en aumento,…
En un movimiento histórico, la Unión Europea ha aprobado la primera ley de inteligencia artificial…
¿Sigues trabajando con Visual Basic 6 y necesitas una forma eficiente de acceder a tus…
OpenAI revoluciona la interacción con IA: ChatGPT ahora interpreta imágenes En un avance significativo para la…
Bienvenido al Curso Básico de Visual Basic 6! Este curso está diseñado para llevarte a…
Este sitio utiliza cookies desea activarlas
Leave a Comment