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.acssa8a3d{aspect-ratio:1/1;background:transparent no-repeat scroll 0% 0%;height:300px;max-width:300px;}div.acss13836{color:#333333;font-family:Arial;font-size:14px;height:75px;}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 *******/
Siguiente con esta lección trabajamos la ventana de inventario en Visual Basic 6, la cual nos muestra el listado de productos de nuestro inventario.
En este vídeo se termina de organizar la ventana de Productos y se inicia con la ventana de Inventario, para la ventana de productos nos faltaba inicializar los campos de formulario poner los campos que llevan texto a vació y lo datos de valor a cero.
Y en la ventana de Inventario se trabajo el LlenarProductosGrid que es para listar los productos del Inventario dependiendo del Filtro que se use.
Sub IniciarTextos()
txtCodigoPro = ""
txtNombrePro.Text = ""
txtNombreCort.Text = ""
txtEstante.Text = "-"
txtExistencia.Text = "0"
txtExistMinima.Text = "0"
txtPrecioCosto.Text = 0
txtImpuesto.Text = 0
txtPrecioCImp.Text = 0
txtProcV1.Text = "0"
txtProcV2.Text = "0"
txtProcV3.Text = "0"
txtProcVMinim.Text = "0"
txtPrecioV1.Text = "0"
txtPrecioV2.Text = "0"
txtPrecioV3.Text = "0"
txtPrecioVMinim.Text = "0"
txtUtilidadP1.Text = "0"
txtUtilidadP2.Text = "0"
txtUtilidadP3.Text = "0"
txtUtilidadP4.Text = "0"
End Sub En el evento Load del formulario y en el Sub Procedimiento Guardado.
Private Sub Form_Load()
CodigoProducto = 0
Call LimpiarTextos
Call LlenarProveedores
Call LlenarCategorias
End Sub Sub GuardarProducto()
If txtCodigoPro.Text = "" Then
MsgBox "Debe llenar el Campo Código", vbExclamation, "Error"
Exit Sub
End If
If txtNombrePro.Text = "" Then
MsgBox "Debe llenar el Campo Nombre del Producto", vbExclamation, "Error"
Exit Sub
End If
If txtNombreCort.Text = "" Then
MsgBox "Debe llenar el Campo Nombre Corto", vbExclamation, "Error"
Exit Sub
End If
If txtEstante.Text = "" Then
MsgBox "Debe llenar el Campo Estante", vbExclamation, "Error"
Exit Sub
End If
If txtPrecioCosto.Text = "" Then
MsgBox "Debe llenar el Campo Precio Costo", vbExclamation, "Error"
Exit Sub
End If
If txtPrecioV1.Text = "" Then
MsgBox "Debe llenar el Campo Precio Venta 1", vbExclamation, "Error"
Exit Sub
End If
If txtImpuesto.Text = "" Then
MsgBox "Debe llenar el Campo Impuesto", vbExclamation, "Error"
Exit Sub
End If
If CodigoProveedor = 0 Then
IdProducto = UltimoIdTabla("tblProductos", "IdProducto")
CodCategoria = cmbCategorias.ItemData(cmbCategorias.ListIndex + 1)
CodProv = cmdProveedor.ItemData(cmdProveedor.ListIndex + 1)
Sql = "Insert Into tblProductos (IdProducto, CodigoPro, NombrePro, NombreCortoPro,EstantePro, ExistPro, ExistMinPro, PCostoPro,PVenta1Pro, PVenta2Pro, PVenta3Pro, PMinimoPro, IdCategoria, IdProveedor) Values (" & IdProducto & ",'" & txtCodigoPro & "','" & txtNombrePro & "','" & txtNombreCort & "','" & txtEstante & "','" & txtExistencia & "','" & txtExistMinima & "','" & txtPrecioCosto & "','" & txtPrecioV1 & "','" & txtPrecioV2 & "','" & txtPrecioV3 & "', '" & txtPrecioVMinim & "', " & CodCategoria & ", " & CodProv & ") "
Else
'Sql = "Update tblProductos SET NombreEmpresaPro = '" & txtNombreEmpresa & "',NitEmpresaPro = '" & txtNit & "',NombrePro = '" & txtNombreContacto & "',TelefonoPro = '" & txtTelefono & "',DireccionPro = '" & txtDireccion & "',EmailPro = '" & txtEmail & "' Where tblProveedores = " & CodigoProveedor
End If
ConexionADO.Execute Sql
MsgBox "Producto Guardado", vbInformation, "Guardar"
Call LimpiarTextos
txtCodigoPro.SetFocus
End Sub El Procedimiento de Llenar Grid es el siguiente:
Sub LlenarProductosGrid()
Dim Sql As String
Dim Filtro As String
Dim Ordenar As String
Dim Columnas As Integer
Dim Op, Ord As Integer
Op = cmdTipoBusqueda.ListIndex
Filtro = ""
Select Case Op
Case 0:
Filtro = " tblProductos.NombrePro Like '%" & txtFiltro & "%'"
Case 1:
Filtro = " tblProductos.CodigoPro Like '%" & txtFiltro & "%'"
Case 2:
Filtro = " tblCategorias.NombreCategoria Like '%" & txtFiltro & "%'"
Case 3:
Filtro = " tblProveedores.NombreEmpresaPro Like '%" & txtFiltro & "%'"
Case 4:
Filtro = " tblProductos.PVenta1Pro >= " & txtFiltro
Case 5:
Filtro = " tblProductos.PVenta1Pro <= " & txtFiltro
End Select
Ord = cmdOrdenarpor.ListIndex
Select Case Ord
Case 0:
Ordenar = " tblProductos.NombrePro ASC "
Case 1:
Ordenar = " tblProductos.CodigoPro ASC "
End Select
Sql = "SELECT tblProductos.IdProducto, tblProductos.CodigoPro, tblProductos.NombrePro, tblProductos.ExistPro, tblProductos.ExistMinPro, Format(tblProductos.PCostoPro,'currency'), Format(tblProductos.PVenta1Pro,'currency'), Format(tblProductos.PVenta2Pro,'currency'), Format(tblProductos.PVenta3Pro,'currency'), Format(tblProductos.PMinimoPro,'currency'), tblCategorias.NombreCategoria, tblProveedores.NombreEmpresaPro " _
& " FROM (tblProductos INNER JOIN tblCategorias ON tblProductos.IdCategoria = tblCategorias.Idcategoria) INNER JOIN tblProveedores ON tblProductos.IdProveedor = tblProveedores.IdProveedor WHERE " & Filtro & " order by " & Ordenar
Columnas = 12
Call LlenarGrid(msGrid, Sql, Columnas)
msGrid.ColWidth(0) = 0
msGrid.ColWidth(1) = 0
msGrid.ColWidth(2) = 1800
msGrid.ColWidth(3) = 4000
msGrid.ColWidth(4) = 1100
msGrid.ColWidth(5) = 1100
msGrid.ColWidth(6) = 1500
msGrid.ColWidth(7) = 1500
msGrid.ColWidth(8) = 1500
msGrid.ColWidth(9) = 1500
msGrid.ColWidth(10) = 2000
msGrid.ColWidth(11) = 2000
msGrid.ColWidth(12) = 4000
msGrid.TextMatrix(0, 2) = "Código"
msGrid.TextMatrix(0, 3) = "Nombre Producto"
msGrid.TextMatrix(0, 4) = "Exist"
msGrid.TextMatrix(0, 5) = "Exis. Min"
msGrid.TextMatrix(0, 6) = "P. Costo"
msGrid.TextMatrix(0, 7) = "P. Venta 1"
msGrid.TextMatrix(0, 8) = "P. Venta 2"
msGrid.TextMatrix(0, 9) = "P. Venta 3"
msGrid.TextMatrix(0, 10) = "P. Mínima"
msGrid.TextMatrix(0, 11) = "Categoría"
msGrid.TextMatrix(0, 12) = "Proveedor"
msGrid.ColAlignment(4) = flexAlignCenterCenter
msGrid.ColAlignment(5) = flexAlignCenterCenter
SumTotal = 0
For Fila = 1 To msGrid.Rows - 1
Exist = msGrid.TextMatrix(Fila, 4)
PrecioCost = CCur(msGrid.TextMatrix(Fila, 6))
SumaTotal = SumaTotal + (Exist * PrecioCost)
Next Fila
txtTotalLista.Text = Format(SumaTotal, "currency")
End Sub Eventos
Private Sub cmdCerrar_Click()
Unload Me
End Sub
Private Sub cmdNuevo_Click()
frmProducto.Show
End Sub
Private Sub Form_Load()
cmdTipoBusqueda.ListIndex = 0
cmdOrdenarpor.ListIndex = 0
Call LlenarProductosGrid
End Sub
Private Sub txtFiltro_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call LlenarProductosGrid
End If
End Sub Saludos, en este tutorial aprenderás a integrar tu aplicación de Visual Basic 6 con un…
Recientemente, muchos usuarios de Hotmail (ahora Outlook.com) han reportado un error al intentar iniciar sesión…
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…
Este sitio utiliza cookies desea activarlas
Leave a Comment