You are on page 1of 8

Private Sub Command1_Click() A = InputBox("Ingrese El Cdigo Del Producto", "Buscar En La Base De Datos") If Val(A) > (0) Then Adodc1.Recordset.

MoveFirst While Not (Adodc1.Recordset.EOF = True) If Val(A) = Adodc1.Recordset(0) Then Exit Sub End If Adodc1.Recordset.MoveNext Wend B = MsgBox("El Producto Que Busca No Esta En La Base De Datos, Desea Agregarlo? ", vbYesNo, "Error De Captura") If Val(B) = vbYes Then Adodc1.Recordset.AddNew Text1 = Val(A) Text2 = InputBox("Ingrese La Descripcin Del Producto", "Captura") Text3 = InputBox("Ingrese El Precio Del Producto", "Captura") If Text2 > "" And Text3 > "" Then Command1.Enabled = False Command2.Enabled = False Command3.Enabled = True Command4.Enabled = True Command5.Enabled = False Command6.Enabled = False Command7.Enabled = False Command8.Enabled = False Else C = MsgBox("Informacin Incompleta, Intntelo Nuevamente", vbCritical, "Error De Reg istro") Adodc1.Refresh Command1.Enabled = True Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command5.Enabled = False Command6.Enabled = True Command7.Enabled = True Command8.Enabled = True Adodc1.Recordset.MoveFirst End If End If End If End Sub Private Sub Command16_Click() A = InputBox(("Cantidad A Cobrar $") + (Label4) + (", Ingrese Pago Recibido:"), "Mensaje De Caja") If Val(A) > (0) And Val(A) >= Val(Label4) Then B = MsgBox("Total: $ " & Val(Label4) & " Efectivo: $ " & Val( A) & " Cambio: $ " & Val(A) - Val(Label4) & " Desea Imprimir El Ticket?", vbYesNo, "Mensaje De Caja") If Val(B) = vbYes Then Adodc2.Recordset.MoveFirst Adodc2.Recordset.MoveNext Printer.Print " ********Gracias Pro Su Preferencia********

" Printer.Print " " Printer.Print " " Printer.Print "==========================================" While Not Adodc2.Recordset.EOF Printer.Print (Text5) + (" ") + (Text6) Printer.Print (" $ ") + (Text8) + (" X ") + (Text7) + (" Pz. ") + (Text9) Adodc2.Recordset.MoveNext If Adodc2.Recordset.EOF Then Printer.Print "==========================================" Printer.Print ("Total: $ ") + (Label4) Printer.Print ("Efectivo: $ ") + (A) Printer.Print ("Cambio: $ "); A - Label4 Printer.Print "==========================================" Printer.Print " " Printer.Print " * * Vuelva Pronto * * " Printer.EndDoc Adodc2.Recordset.MoveFirst List1.Clear Label4 = "" Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command17.Visible = False Command16.Visible = False Adodc2.Recordset.MoveFirst Adodc2.Recordset.MoveNext If Text5 > (0) Then While Not Adodc2.Recordset.EOF Adodc2.Recordset.Delete Adodc2.Recordset.MoveNext If Adodc2.Recordset.EOF Then Adodc2.Recordset.MoveFirst Adodc2.Recordset.Update Exit Sub End If Wend End If Exit Sub End If Wend Else List1.Clear Label4 = "" Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command16.Visible = False Command17.Visible = False Adodc2.Recordset.MoveFirst Adodc2.Recordset.MoveNext

If Text5 > (0) Then While Not Adodc2.Recordset.EOF Adodc2.Recordset.Delete Adodc2.Recordset.MoveNext If Adodc2.Recordset.EOF Then Adodc2.Recordset.MoveFirst Adodc2.Recordset.Update Exit Sub End If Wend End If End If End If End Sub Private Sub Command12_Click() Frame2.Visible = False Frame1.Visible = True End Sub Private Sub Command13_Click() End End Sub Private Sub Command7_Click() A = MsgBox("Esta Seguro Que Desea Salir?", vbYesNo, "Saliendo") If Val(A) = vbYes Then End End If End Sub Private Sub Command8_Click() Combo1.Clear Adodc1.Recordset.MoveFirst Adodc1.Recordset.MoveNext While Not Adodc1.Recordset.EOF Combo1.AddItem (Text2) Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst Command1.Enabled = False Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command5.Enabled = False Command6.Enabled = False Command7.Enabled = False Command8.Enabled = False Command9.Visible = True Combo1.Visible = True Text2.Visible = False Exit Sub End If Wend End Sub Private Sub Command9_Click() If Combo1 <> "" Then Adodc1.Recordset.MoveFirst

While Not (Adodc1.Recordset.EOF = True) If Combo1 = Adodc1.Recordset(1) Then Exit Sub End If Adodc1.Recordset.MoveNext Command1.Enabled = True Command2.Enabled = True Command3.Enabled = False Command4.Enabled = False Command5.Enabled = True Command6.Enabled = True Command7.Enabled = True Command8.Enabled = True Command9.Visible = False Combo1.Visible = False Text2.Visible = True Wend End If End Sub Private Sub Command14_Click() If List2 <> "" Then Adodc1.Recordset.MoveFirst While Not (Adodc1.Recordset.EOF = True) If List2 = Adodc1.Recordset(1) Then If Val(Text5) > (0) Then Command10.Visible = True Command11.Visible = True Command12.Visible = False Command13.Visible = False Command14.Visible = False Command15.Visible = False Command16.Visible = True Command17.Visible = True Else Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command16.Visible = False Command17.Visible = False End If List1.Visible = True List2.Visible = False B = InputBox((Text1) + (" ") + (Text2) + (" Precio: $") + (Text3) + (" Cantidad A Vender?"), "Ingresar Cantidad") If Val(B) > (0) Then Text4 = Val(B) * Val(Text3) C = Val(Text4) + Val(Label4) Label4 = Val(C) List1.AddItem (Text1) + (" ") + (Text2) List1.AddItem ("Precio: $") + (Text3) + (" Cantidad: ") + (B) + (" Subtotal: $") + (Text4) Adodc2.Recordset.AddNew Text5 = Text1 Text6 = Text2 Text7 = Val(B) Text8 = Text3

Text9 = Text4 Adodc2.Recordset.Update If Val(Text5) > (0) Then Command10.Visible = True Command11.Visible = True Command12.Visible = False Command13.Visible = False Command14.Visible = False Command15.Visible = False Command16.Visible = True Command17.Visible = True Else Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command16.Visible = False Command17.Visible = False End If End If Exit Sub End If Adodc1.Recordset.MoveNext Wend End If End Sub Private Sub Command15_Click() If Val(Text5) > (0) Then List2.Clear Command10.Visible = True Command11.Visible = True Command12.Visible = False Command13.Visible = False Command14.Visible = False Command15.Visible = False Command16.Visible = True Command17.Visible = True List1.Visible = True List2.Visible = False Else List2.Clear Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command16.Visible = False Command17.Visible = False List1.Visible = True List2.Visible = False End If End Sub Private Sub Command2_Click() Text2.Enabled = True

Text3.Enabled = True Command1.Enabled = False Command2.Enabled = False Command3.Enabled = True Command4.Enabled = True Command5.Enabled = False Command6.Enabled = False Command7.Enabled = False Command8.Enabled = False End Sub Private Sub Command3_Click() If Text2 > "" And Text3 > "" Then Adodc1.Recordset.Update Adodc1.Recordset.MoveFirst Command1.Enabled = True Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command5.Enabled = False Command6.Enabled = True Command7.Enabled = True Command8.Enabled = True Text2.Enabled = False Text3.Enabled = False Else C = MsgBox("Informacin Incompleta, Intntelo Nuevamente ", vbCritical, "Error De Re gistro") End If End Sub Private Sub Command4_Click() A = MsgBox("Desea Cancelar Los Cambios Efectuados?", vbYesNo, "Cancelando") If Val(A) = vbYes Then Adodc1.Recordset.CancelUpdate Adodc1.Recordset.MoveFirst Command1.Enabled = True Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command5.Enabled = False Command6.Enabled = True Command7.Enabled = True Command8.Enabled = True Text2.Enabled = False Text3.Enabled = False End If End Sub Private Sub Command5_Click() A = MsgBox("Esta Seguro De Eliminar El Registro", vbOKCancel, "Eliminar") If Val(A) = vbOK Then Adodc1.Recordset.Delete End If Adodc1.Recordset.MoveFirst End Sub Private Sub Command6_Click() Frame1.Visible = False Frame2.Visible = True

End Sub Private Sub Command10_Click() A = InputBox("Ingrese El Cdigo Del Producto", "Ingresar Producto") If Val(A) > (0) Then Adodc1.Recordset.MoveFirst While Not (Adodc1.Recordset.EOF = True) If Val(A) = Adodc1.Recordset(0) Then If Val(A) > (0) Then B = InputBox((Text1) + (" ") + (Text2) + (" Precio: $") + (Text3) + (" Cantidad A Vender?"), "Ingresar Cantidad") If Val(B) > (0) Then Text4 = Val(B) * Val(Text3) C = Val(Text4) + Val(Label4) Label4 = Val(C) List1.AddItem (Text1) + (" ") + (Text2) List1.AddItem ("Precio: $") + (Text3) + (" Cantidad: ") + (B) + (" Subtotal: $") + (Text4) Adodc2.Recordset.AddNew Text5 = Text1 Text6 = Text2 Text7 = Val(B) Text8 = Text3 Text9 = Text4 Command10.Visible = True Command11.Visible = True Command12.Visible = False Command13.Visible = False Command14.Visible = False Command15.Visible = False Command16.Visible = True Command17.Visible = True List1.Visible = True List2.Visible = False Adodc2.Recordset.Update End If Exit Sub End If End If Adodc1.Recordset.MoveNext Wend D = MsgBox("Codigo De Producto Incorrecto", vbCritical, "Error De Captura") Adodc1.Recordset.MoveFirst End If End Sub Private Sub Command11_Click() List2.Clear Adodc1.Recordset.MoveFirst Adodc1.Recordset.MoveNext While Not Adodc1.Recordset.EOF List2.AddItem (Text2) Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveFirst Command10.Visible = False Command11.Visible = False Command12.Visible = False

Command13.Visible = False Command14.Visible = True Command15.Visible = True Command16.Visible = False Command17.Visible = False List1.Visible = False List2.Visible = True Exit Sub End If Wend End Sub Private Sub Command17_Click() A = MsgBox("Esta Seguro De Cancelar Esta Venta?", vbYesNo, "Cancelando") If Val(A) = vbYes Then List1.Clear Label4 = "" Command10.Visible = True Command11.Visible = True Command12.Visible = True Command13.Visible = True Command14.Visible = False Command15.Visible = False Command16.Visible = False Command17.Visible = False If Text5 > (0) Then Adodc2.Recordset.MoveFirst Adodc2.Recordset.MoveNext While Not Adodc2.Recordset.EOF Adodc2.Recordset.Delete Adodc2.Recordset.MoveNext If Adodc2.Recordset.EOF Then Adodc2.Recordset.MoveFirst Adodc2.Recordset.Update Exit Sub End If Wend End If End If End Sub Private Sub Text1_Change() If Val(Text1) = (0) Then Command2.Enabled = False Command5.Enabled = False Else Command2.Enabled = True Command5.Enabled = True End If End Sub

You might also like