Sie sind auf Seite 1von 4

Option Explicit Sub LIMPIAR() CONT = Val(rs.Fields("TRAZABILIDAD")) + 1 rs.AddNew rs.Fields("TRAZABILIDAD") = CONT rs.Update rs1.MoveFirst While Not rs1.

EOF = True rs1.Delete rs1.MoveFirst Wend

Command2.Caption = " 0.00" Command3.Caption = "0.00" End Sub Private Sub Command1_Click() If Not rs1.EOF And Not rs1.BOF Then rs1.Delete End If End Sub Private Sub Command10_Click() SSTab1.Tab = 2 End Sub Private Sub Command11_Click() While Not rs1.EOF rs1.Delete rs1.MoveNext Wend Unload Me End Sub Private Sub Command12_Click() SSTab1.Tab = 3 End Sub Private Sub Command4_Click() If Command2.Caption <> "0.00" And Command3.Caption <> "0.00" Then Call ingreso_sumario End If End Sub Private Sub Command5_Click() Command5.Enabled = False USUARIOS.Show

End Sub Private Sub Command7_Click() SSTab1.Tab = 4 End Sub Private Sub Command8_Click() rs1.MoveFirst While Not rs1.EOF rs1.Delete rs1.MoveNext Wend End Sub Private Sub Command9_Click() SSTab1.Tab = 1 End Sub Private Sub Form_Load()

rs.Open "select*from TRAZABILIDAD", CN, adOpenStatic, adLockOptimistic rs1.Open "select*from VENTA", CN, adOpenStatic, adLockOptimistic rsX.Open "SELECT*FROM CATALOGO", CN, adOpenDynamic, adLockOptimistic rs3.Open "Select*from SUMARIO", CN, adOpenStatic, adLockOptimistic Set Set Set Set Set Set Set VENTAGRID.DataSource = rs1 BUSQUEDAGRID.DataSource = rsX DATACATALOG.DataSource = rsX Label1.DataSource = rsX Label2.DataSource = rsX Text3.DataSource = rsX Label6.DataSource = rs

Label6.DataField = "TRAZABILIDAD" Label1.DataField = "CODIGO" Label2.DataField = "DESCRIPCION" Text3.DataField = "VALOR" Command2.Caption = " 0.00" Command3.Caption = "0.00" rs.MoveLast SSTab1.Enabled = False End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If Not Label1.Caption = "" And Not Label2.Caption = "" And Not Text3.Text = "0" And Not Text1.Text = "" And Not Label4.Caption = "" And Not Label5.Caption = "" Then If KeyAscii = 13 Then Call ingreso_venta End If End If

If KeyAscii = 13 And Label1.Caption = "000" Then Text3.Enabled = True Text3.Text = "" Text3.SetFocus Text1.Text = "" End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Option1.Value = True Then If KeyAscii = 13 And Not Text2.Text = "" Then rsX.MoveFirst rsX.Find "CODIGO LIKE '" & Text2 & "'" Text1.Text = "" Text1.SetFocus End If End If If Option2.Value = True Then If KeyAscii = 13 And Not Text2.Text = "" Then rsX.MoveFirst rsX.Find "DESCRIPCION LIKE '" & Text2 & "'" Text1.Text = "" Text1.SetFocus End If End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer) If KeyAscii = 13 And Text3.Text <> "" Then Call ingreso_venta End If End Sub Private Sub Timer1_Timer() Label4.Caption = Date Label5.Caption = Time$

End Sub Public Sub ingreso_venta() rs1.AddNew rs1.Fields("CODIGO") = Label6.Caption rs1.Fields("DESCRIPCION") = Label2.Caption rs1.Fields("PRECIO") = CLng(Text3.Text) rs1.Fields("CANTIDAD") = CLng(Text1.Text) rs1.Fields("TOTAL") = CLng(Text3.Text) * CLng(Text1.Text)

rs1.Fields("FECHA") = Label4.Caption rs1.Fields("HORA") = Label5.Caption rs1.Update CONT1 = 0 CONT2 = 0 rs1.MoveFirst Do While rs1.EOF = False CONT1 = CONT1 + CLng(rs1.Fields("TOTAL")) CONT2 = CONT2 + CLng(rs1.Fields("CANTIDAD")) rs1.MoveNext Loop Command2.Caption = " " & CONT1 Command3.Caption = CONT2 rs1.MoveFirst Text3.Enabled = False rsX.MoveFirst rsX.Fields("VALOR") = "0" rsX.Update End Sub Public Sub ingreso_sumario() Do While Not rs1.EOF = True With rs3 .AddNew .Fields("TRAZABILIDAD") = Label6.Caption .Fields("CODIGO") = rs1.Fields("CODIGO") .Fields("DESCRIPCION") = rs1.Fields("DESCRIPCION") .Fields("PRECIO") = rs1.Fields("PRECIO") .Fields("CANTIDAD") = rs1.Fields("CANTIDAD") .Fields("TOTAL") = rs1.Fields("TOTAL") .Fields("FECHA") = rs1.Fields("FECHA") .Fields("HORA") = rs1.Fields("HORA") .Update End With rs1.MoveNext Loop Call LIMPIAR End Sub

Das könnte Ihnen auch gefallen