Private Sub cmdagregar_Click()
If Trim(Nz(Me.txtcodpro.Value = "" Or Me.txtcantidad.Value = "" Or Me.txtdeslem.Value = "" Or Me.txtdespor.Value = "")) = "" Then
MsgBox "Parece que uno de los campos esta vacio", vbInformation, "System"
Me.txtcodpro.SetFocus
Else
Me.Lista158.ColumnCount = 9
Me.Lista158.AddItem Me.txtcodpro & ";" & Me.txtdescrip & ";" & Me.txtdescripcion & ";" & Me.txtcantidad & ";" & Format(Me.txtprecio, "currency") & ";" & Me.txtdespor & ";" & Format(Me.txtdeslem, "currency") & ";" & Format(Me.suma, "currency") & ";" & Me.txtFactura1 & ";"
Dim i As Integer
Dim Sumatotal As Double
For i = 0 To Me.Lista158.ListCount - 1
Sumatotal = Nz(Sumatotal, 0) + Me.Lista158.Column(7, i)
Next i
Me.txtsuma = Sumatotal
Me.cmdagregar.Enabled = False
Me.cmdnuevo1.Enabled = True
Me.txtcodpro.Value = Null
Me.txtcantidad.Value = Null
Me.txtdescrip.Value = Null
Me.txtdescripcion.Value = Null
Me.txtdeslem.Value = Null
Me.txtdespor.Value = Null
Me.txtdescrip.Value = Null
Me.txtprecio.Value = Null
Me.txtcodpro.Enabled = False
Me.txtcantidad.Enabled = False
Me.txtdescrip.Enabled = False
Me.txtdescripcion.Enabled = False
Me.txtdespor.Enabled = False
Me.txtdeslem.Enabled = False
Me.txtprecio.Enabled = False
Me.cmseliminar.Enabled = True
Me.suma.Enabled = False
End If
End Sub
Private Sub Lista158_Click()
Dim xxx As String
xxx = Me.[Lista158].RowSource
Me.Texto318.Value = xxx
End Sub
Private Sub Comando320_Click()
Me.Lista158.RowSource = Me.Texto318.Value
End Sub