Indice:
Requerimientos Técnicos del Sistema
Formato de Descripción de Pantallas
Introducción:
La Carpeta de Proyecto muestra el diagrama del sistema “Balasys”, la descripción de los procesos realizados por el sistema, los requerimientos técnicos del sistema, los modulos del programa, los formatos de registros, los formatos de la descripción de pantallas, los mensajes que muestra el programa, el diseño de los reportes, la caducidad de los archivos, así como los respaldos realizados al sistema.
Diagrama del Sistema:
Descripción de Procesos:
El sistema “Balasys” ayuda a tener un inventario actualizado sin necesidad de realizarlo físicamente, ya que al momento de realizar una compra o una venta se actualiza automáticamente los inventarios.
El Proceso de Compra es mas fácil ya que al contarse con un catalogo de productos y proveedores, automáticamente al poner el numero de producto que se va a vender nos muestra toda la información correspondiente, sin necesidad de capturar todo y nos da con esto el importe total de la compra, lo mismo sucede con el proveedor.
El Proceso de Ventas también se hace
automáticamente al igual que en las compras se da el numero o números
de productos que serán vendidos y nos muestra toda la información
de los productos y nos da el importe de la venta, y automáticamente
si se desea se realiza la factura correspondiente.
Requerimientos Técnicos del Sistema:
Modulos:
Menú Principal del Sistema Balasys
Tablas de Programas:
# |
Nombre del Programa |
Objetivo |
Tablas que Afecta |
|
1
|
Form1.frm
|
Muestra por unos segundos el nombre del Sistema.
|
Al terminar de mostrarse esta pantalla inmediatamente se muestra la Pantalla Principal Sistema. |
2
|
Form2.frm
|
Muestra la Pantalla Principal del Sistema donde estan contenido un
menú donde se muestran las siguientes opciones: catalogos, servicios,
reportes, ayuda y salir. Que al momento de seleccionar alguno de ellos
muestra la información correspondiente.
|
Al momento de seleccionar alguna opcion del menú, se manda llamar
otra pantalla. Al seleccionar el catalogo de Productos se muestra la forma form3.frm. Al seleccionar el catalogo de clientes se muestra la forma form5.frm. Al seleccionar el catalogo de proveedores se muestra la forma form6.frm. Al seleccionar el catalogo de vendedores se muestra la forma form7.frm. Al seleccionar el catalogo de inentari se muesta la forma form11.frm. Al seleccionar el servicio de compra se muestra la forma form12.frm. Al seleccionar el servicio de cotizacion se mustra la forma form8.frm. Al seleccionar el servicio de faturacion se muestra la forma form9.frm. Al seleccionar el Reporte de Productos se muestra la forma form13.frm. Al seleccionar el Reporte de clientes se muestra la forma form14.frm. Al seleccionar el Reporte de Proveedores se muestra la forma form15.frm. Al seleccionar el Reporte de Vendedores se muestra la forma form16.frm. Al seleccionar el Reporte de Inventario se muestra la forma form17.frm. Al seleccionar el Reporte de Compra se muestra la forma form20.frm. Al seleccionar el Reporte de Cotizacion se muestra la forma form21.frm. Al seleccionar el Reporte de facturación se muestra la forma form22.frm. Al seleccionar la ayuda de acerca de se muestra la forma form10.frm. Al seleccionar salir se muestra la forma form4.frm. |
3
|
Form3.frm
|
Muestra el Catalogo e Productos, donde se muestran los Datos del Producto
como es Numero de Producto, Nombre del Producto, Precio del Producto,
Existecia, Nombre de la marca, Numero de Proveedor, y el Nombre del Proveedor. Tambien muestra las opciones de insertar un nuevo poducto, modificar los datos de algun producto existente, buscar algún producto, y eliminar algun producto. |
Al hacer cualquier proceso en esta forma se modifica la tabla de productos de la base de datos Master Electrica.mdb
|
4
|
Form5.frm
|
Muestra el Catalgo de Clientes, donde se muestran los datos de los clientes, como el numero del cliente, el nombre, la direccion y el telefono. Asi como las opciones de insertar un nuevo cliente, modificar algun cliente existente, buscar un cliente en especifico y eliminar algun cliente. | Al hacer cualquier proceso en esta forma se modifica la tabla de clientes de la base de datos Master Electrica.mdb
|
5
|
Form6.frm
|
Muestra el Catalogo de Proveedores, donde se muestran los datos de los proveedores como son numero de proveedor, nombre, direccion, telefono, e-mail, RFC, ciudad y el contacto del proveedor. Asi como las opciones de insertar un nuevo proveedor, modificar algun proveedor existente, buscar un proveedor en especifico y eliminar algun proveedor. | Al hacer cualquier proceso en esta forma se modifica la tabla de proveedores de la base de datos Master Electrica.mdb
|
6
|
Form7.frm
|
Muestra el Catalogo de Vendedores, donde se muestran los datos de los vendedores como son numero de vendedor y nombre. Asi como las opciones de insertar un nuevo vendedor, modificar algun dato de un vendedor existente, buscar un vendedor en especifico y eliminar algun vendedor. | Al hacer cualquier proceso en esta forma se modifica la tabla de vendedores de la base de datos Master Electrica.mdb
|
7
|
Form11.frm
|
Muestra el Catalogo de Inventario, donde se muestran el numero del producto y la existencia del producto. Asi como las opciones de insertar un producto al inventario, elimar un producto del invenario y buscar algun producto en especifico. | Al hacer cualquier proceso en esta forma se modifica la tabla de productos de la base de datos Master Electrica.mdb
|
8
|
Form12.frm
|
Muestra el Formato para realizar una compra de productos, donde se muestran
los datos de la compra, como son el numero de compra, el numero y nombre
de proveedor, numero y nombre del producto, la cantidad del producto a
comprar, el costo unitario y nos calcula el importe de la compra. Asi como las opciones de insertar una nueva compra, modificar los datos de alguna compra existente, buscar y eliminar una compra. |
Al hacer cualquier proceso en esta forma se modifica la tabla de compra de la base de datos Master Electrica.mdb
|
9
|
Form8.frm
|
Muestra el Formato para Realizar una Cotizacion, mostrando todos los
datos necesarios al momento de realizarla como son Numero de cotizacion,
datos del cliente, fecha, numero de producto a cotizar, cantidad, el precio,
obteniendo asi el importe total de la cotizacion. Tambien se muestran las opciones de insertar una nueva cotizacion, modificar los datos de alguna cotizacion existente, buscar alguna cotizacion, eliminar la cotizacion, y facturar la cotizacion. Asi como la opcion de Imprimir Cotización. |
Al hacer cualquier proceso en esta forma se modifica la tabla de
cotizacion de la base de datos Master Electrica.mdb
|
|
10
|
Form9.frm
|
Muestra el Formato para Realizar una factura, mostrando todos los datos
necesarios al momento de realizarla como son Numero de factura, numero
de cotizacion realizada, datos del cliente, fecha, numero de producto
a facturar, cantidad, el precio, importe total de la factura. Tambien se muestran las opciones de insertar una nueva factura, modificar los datos de alguna factura existente, buscar alguna factura, eliminar la factura. Asi como la opcion de imprimir Factura. |
Al hacer cualquier proceso en esta forma se modifica la tabla de
factura de la base de datos Master Electrica.mdb
|
| 11 | Form13.frm | Muestra el Reporte de Productos generado por el programa CrystalReport, llamado CrystalReport1.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 12 | Form14.frm | Muestra el Reporte de Clientes generado por el programa CrystalReport, llamado CrystalReport2.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 13 | Form15.frm | Muestra el Reporte de Proveedores generado por el programa CrystalReport, llamado CrystalReport3.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 14 | Form16.frm | Muestra el Reporte de Vendedores generado por el programa CrystalReport, llamado CrystalReport4.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 15 | Form17.frm | Muestra el Reporte del Inventario generado por el programa CrystalReport, llamado CrystalReport5.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 16 | Form20.frm | Muestra el Reporte de las Compras generado por el programa CrystalReport, llamado CrystalReport6.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 17 | Form21.frm | Muestra el Reporte de las Cotizaciones generado por el programa CrystalReport, llamado CrystalReport7.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 18 | Form22.frm | Muestra el Reporte de las Facturas generado por el programa CrystalReport, llamado CrystalReport8.Dsr | No afecta ninguna tabla, nomas se visualiza un reporte. |
| 19 | Form10.frm | Muestra el acerca de… dentro de la ayuda donde se muestran los datos del sistema. | |
| 20 | Form4.frm | Muestra una forma donde se pregunta si esta seguro de querer salir del programa | |
| 21 | Form18.frm | Muestra una forma donde se encuentra el formato a impresión de la cotización. | |
| 22 | Form19.frm | Muetra una forma donde se encuentra el formato a impresión de la cotización. | |
| 23 | Master Electrica.mdb | Es la base de datos donde se guardan todos los datos del sistema. Esta base de datos es en acces. | Cada vez que se hace un proceso en el sistema se modifica esta base de datos. |
Tabla de Reportes Generales:
Nombre del Reporte |
Objetivo |
Frecuencia con la que se Genera |
| CrystalReport1.Dsr | Muestra el Reporte de Productos, donde se muestra un listado de la información de los productos de la empresa, como es el numero, nombre, numero de proveedor, marca, costo unitario y existencia. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport2.Dsr | Muestra el Reporte de Clientes, donde se muestra un listado de la información de los clientes de la empresa, como es el numero, nombre, direccion y telefono. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport3.Dsr | Muestra el Reporte de Proveedores, donde se muestra un listado de la información de los proveedores de la empresa, como es el numero, nombre, direccion, telefono, e-mail, RFC, ciudad y contacto. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport4.Dsr | Muestra el Reporte de Vendedores, donde se muestra un listado de la información de los vendedores de la empresa, como es el numero y nombre. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport5.Dsr | Muestra el Reporte de Inventario, donde se muestra un listado de la información del inventario como es el numero del producto y la existencia. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport6.Dsr | Muestra el Reporte de Compras, donde se muestra un listado de todas las compras realizadas por la empresa, mostrando su información como es numero de compra, numero de proveedor, numero de producto, cantidad de productos comprados, costo unitario del producto, importe de la compra, y la fecha de la compra. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport7.Dsr | Muestra el Reporte de Cotizacion, donde se muestra un listado de todas las cotizaciones realizadas por la empresa, mostrando su información como es numero de cotizacion, numero de cliente, el numero de los productos cotizados, la cantidad de productos cotizados, el costo unitario del producto, el importe de la cotizacion, el descuento realizado, asi como el total de la cotizacion y la fecha en que se cotizó. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
| CrystalReport8.Dsr | Muestra el Reporte de Facturas, donde se muestra un listad de todas las facturas realizadas por la empresa, mostrando su información como es el numero de cotizacion, numero del cliente, numero de descuento, y el importe de la factura, asi como la fecha en que se facturo. | Se Genera cada vez que se selecciona la opción de Reportes del Menu Principal del Sistema. |
Formato de Descripción de Pantallas:
Mensajes del Programa:
Al entrar al Sistema muestra un mensaje de bienvenida.
Al momento de insertar un nuevo producto, factura, proveedor, cotizacion,
cliente, etc. Y ya existe el numero que se le esta asignando se manda un mensaje
para informar que ya existe.
Al momento de Seleccionar la opción de buscar en la forma de catalogo de productos muestra un mensaje preguntando el numero del producto a buscar.
Al momento de poner el numero y darle ok aparece la información del
producto a buscar.
Lo mismo sucede en los demas catalogos y en los diferentes servicios.
Al momento de realizar una búsqueda, si no se encuentra el elemento buscado, se manda un mensaje notificandolo.
Cuando se selecciona la opcion de eliminar dentro de alguna de las formas del programa se muestra un mensaje para confirmar si esta seguro de eliminar algun dato.
Al momento de Realizar una Cotización, se pueden cotizar 5 productos,
si se desea cotizar menos de 5 productos, se debe de llenar los espacios restantes
con Cero.
Al momento de realizar una cotizacion, se pueden cotizar 5 productos, si al
darlos de alta se desea borrar alguno de esos productos, se muestra un mensaje
preguntando el numero de producto que desea borrar.
Al momento de Realizar una alta, si no se llenan todos los campos, se manda un mensaje notificándolo.
Al momento de realizar una cotización, si se desea cotizar un producto
que no tiene existencia en el almacen, se manda un mensaje para notificarlo.
Al seleccionar la opcion de imprimir cualquiera de los reportes muestra el
siguiente mensaje para mandarlo a imprimir.
Diseño de Reportes:
Listado Ultima Compilación:
Form1.frm
Private Sub Form_Load()
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
End Sub
Private Sub Timer1_Timer()
Unload Me
Dim c As String
nameusua = InputBox("Nombre del Usuario:")
If nameusua = "Ana" Or nameusua = "ana" Or nameusua =
"ANA" Then
MsgBox "Bienvenida Ana"
ElseIf nameusua = "Alex" Or nameusua = "alex" Or nameusua
= "ALEX" Then
MsgBox "Bienvenido Alex"
ElseIf nameusua = "Brenda" Or nameusua = "brenda" Or nameusua
= "BRENDA" Then
MsgBox "Bienvenida Brenda"
ElseIf nameusua = "Leonardo" Or nameusua = "LEONARDO"
Or nameusua = "leonardo" Then
MsgBox "Bienvenido Leonardo"
Else
MsgBox "Lo Siento, El Usuario no Existe", vbInformation, "Error"
End
End If
Form2.Show
End Sub
Form2.frm
Private Sub Acercade_Click()
Form10.Show
End Sub
Private Sub Clientes_Click()
Form5.Show
End Sub
Private Sub Clientes_Reporte_Click()
Form14.Show
End Sub
Private Sub Compra_Click()
Form12.Show
End Sub
Private Sub Compra_Reporte_Click()
Form20.Show
End Sub
Private Sub Cotizacion_Click()
Form8.Show
End Sub
Private Sub Cotizacion_Reporte_Click()
Form21.Show
End Sub
Private Sub Facturacion_Click()
Form9.Show
End Sub
Private Sub Facturacion_Reporte_Click()
Form22.Show
End Sub
Private Sub Inventario_Click()
Form11.Show
End Sub
Private Sub Inventario_Reporte_Click()
Form17.Show
End Sub
Private Sub Producto_Reporte_Click()
Form3.Show
End Sub
Private Sub Productos_Click()
Form13.Show
End Sub
Private Sub Proveedores_Click()
Form6.Show
End Sub
Private Sub Proveedores_Reporte_Click()
Form15.Show
End Sub
Private Sub Salir_Click()
Form4.Show
End Sub
Private Sub Vendedores_Click()
Form7.Show
End Sub
Private Sub Vendedores_Reporte_Click()
Form16.Show
End Sub
Form3.frm
Dim bd As Database
Dim rsinv As Recordset
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd4 As Database
Dim rsinv4 As Recordset
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero del Producto a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "No_Producto Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro ese Producto")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text6.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Data1.Enabled = True
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Producto " & Text1.Text
Data1.Caption = "Producto " & (Data1.Recordset.AbsolutePosition
+ 1)
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text6.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text6.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Data1.Enabled = True
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text6.Enabled = True
Text12.Enabled = True
Cancelar.Enabled = True
Guardar.Enabled = False
Modificar.Enabled = False
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
Command5.Enabled = False
GuardarCambios.Enabled = True
Data1.Enabled = False
End Sub
Private Sub Insertar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text6.Enabled = True
Text12.Enabled = True
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Command5.Enabled = False
Insertar.Enabled = False
GuardarCambios.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar el Producto: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text6.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
End Sub
Private Sub Command5_Click()
Form2.Show
Form3.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Guardar_Click()
'Data1.Recordset.FindFirst ("No_Producto='" & Text1.Text &
"' ")
'If Data1.Recordset.NoMatch = True Then
If Text1.Text = "" Or Text4.Text = "" Or Text3.Text =
"" Or Text2.Text = "" Or Text12.Text = "" Or
Text6.Text = "" Or Text13.Text = "" Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from Producto")
rsinv.FindFirst ("No_Producto='" & Text1.Text & "'
")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe ese Producto"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text6.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Data1.Enabled = True
End If
End If
End Sub
Private Sub Text6_Change()
Dim Y As String
If Text6.Text = "" Or Text6.Text = "0" Then
Text13.Text = " "
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from proveedores where no_proveedor='"
& Text6.Text & "' ", dbOpenDynaset)
If rsinv.EOF Then
MsgBox "No existe ese proveedor"
Text6.SetFocus
Else
Text13.Text = rsinv("nom_prov")
End If
End If
End Sub
Form4.frm
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
Form2.Show
Form4.Visible = False
Unload Me
End Sub
Private Sub Form_Load()
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
End Sub
Form5.frm
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero del Cliente a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_cliente Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro ese Cliente")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
End Sub
Private Sub Command5_Click()
Form2.Show
Form5.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Cliente " & Text1.Text
'Data1.Caption = "Cliente " & (Data1.Recordset.AbsolutePosition
+ 1)
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Eliminar el Cliente Seleccionado: ", vbYesNo,
"Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Form_Load()
Cancelar.Enabled = False
Guardar.Enabled = False
End Sub
Private Sub Guardar_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text =
"" Or Text4.Text = "" Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from clientes")
rsinv.FindFirst ("no_cliente='" & Text1.Text & "' ")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe ese Cliente"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
End If
End If
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
End Sub
Private Sub Insertar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
GuardarCambios.Enabled = False
Command5.Enabled = False
Insertar.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
Modificar.Enabled = False
Data1.Enabled = False
End Sub
Form6.frm
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero del Proveedor a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_proveedor Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro ese Proveedor")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text12.Enabled = False
Text6.Enabled = False
Text13.Enabled = False
Text5.Enabled = False
End Sub
Private Sub Command5_Click()
Form2.Show
Form6.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Proveedor " & Text1.Text
'Data1.Caption = "Producto " & (Data1.Recordset.AbsolutePosition
+ 1)
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar el Proveedor Seleccionado: ", vbYesNo,
"Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Form_Load()
Cancelar.Enabled = False
Guardar.Enabled = False
End Sub
Private Sub Guardar_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text =
"" Or Text4.Text = "" Or Text12.Text = "" Or
Text6.Text = "" Or Text13.Text = "" Or Text5.Text = ""
Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from proveedores")
rsinv.FindFirst ("no_proveedor='" & Text1.Text & "'
")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe ese Proveedor"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text12.Enabled = False
Text6.Enabled = False
Text13.Enabled = False
Text5.Enabled = False
End If
End If
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text12.Enabled = False
Text6.Enabled = False
Text13.Enabled = False
Text5.Enabled = False
End Sub
Private Sub Insertar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text12.Enabled = True
Text6.Enabled = True
Text13.Enabled = True
Text5.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Insertar.Enabled = False
Command5.Enabled = False
GuardarCambios.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text12.Enabled = True
Text6.Enabled = True
Text13.Enabled = True
Text5.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
Modificar.Enabled = False
Command5.Enabled = False
GuardarCambios.Enabled = True
Data1.Enabled = False
End Sub
Form7.frm
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero del Vendedor a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_vendedor Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro ese Vendedor")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Data1.Enabled = True
End Sub
Private Sub Command5_Click()
Form2.Show
Form7.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Vendedor " & Text1.Text
'Data1.Caption = "Producto " & (Data1.Recordset.AbsolutePosition
+ 1)
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar el Vendedor: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End Sub
Private Sub Form_Load()
Cancelar.Enabled = False
Guardar.Enabled = False
End Sub
Private Sub Guardar_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from vendedores")
rsinv.FindFirst ("no_vendedor='" & Text1.Text & "'
")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe ese Vendedor"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Data1.Enabled = True
End If
End If
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
Data1.Enabled = True
End Sub
Private Sub Insertar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Insertar.Enabled = False
Command5.Enabled = False
GuardarCambios.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
Data1.Enabled = False
End Sub
Form8.frm
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd As Database
Dim rsinv As Recordset
Dim i As Currency
Dim bd2 As Database
Dim rsinv2 As Recordset
Dim bd3 As Database
Dim rsinv3 As Recordset
Dim c As Integer
Dim Y As Currency
Dim a As Currency
Dim b As Currency
Dim f As Currency
Dim d As Currency
Dim e As Currency
Public c1, c2, c3, c4, c5 As Integer
Public p1, p2, p3, p4, p5 As Integer
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero de la Cotización a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_cotizacion Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro esa Cotización")
End If
End Sub
Private Sub Cancelar_Click()
Command9.Enabled = False
Command15.Enabled = False
Command6.Enabled = True
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Command6.Enabled = True
Command8.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Text9.Enabled = False
Text26.Enabled = False
Text32.Enabled = False
Text31.Enabled = False
Text21.Enabled = False
Text19.Enabled = False
Text27.Enabled = False
Text17.Enabled = False
Text22.Enabled = False
Text4.Enabled = False
Text3.Enabled = False
Text2.Enabled = False
Text1.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
End Sub
Private Sub Command1_Click()
Form19.Show
End Sub
Private Sub Command15_Click()
Text13.Text = Text7.Text + i
Text13.Visible = True
End Sub
Private Sub Command5_Click()
Form2.Show
Form8.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Command6_Click()
Form9.Show
End Sub
Private Sub Command8_Click()
Dim Borrar As String
Borrar = InputBox("Numero del Producto que Deseas Borrar: ")
If Borrar = "1" Then
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text43.Text = ""
Text4.Text = ""
Text3.Text = ""
End If
If Borrar = "2" Then
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text44.Text = ""
Text17.Text = ""
Text22.Text = ""
End If
If Borrar = "3" Then
Text27.Text = ""
Text19.Text = ""
Text38.Text = ""
Text29.Text = ""
Text30.Text = ""
Text45.Text = ""
End If
If Borrar = "4" Then
Text21.Text = ""
Text31.Text = ""
Text33.Text = ""
Text34.Text = ""
Text35.Text = ""
Text46.Text = ""
End If
If Borrar = "5" Then
Text38.Text = ""
Text39.Text = ""
Text53.Text = ""
Text47.Text = ""
Text26.Text = ""
Text32.Text = ""
End If
End Sub
Private Sub Command9_Click()
If Text43.Text = "" Then
Text43.Text = "0"
End If
If Text44.Text = "" Then
Text44.Text = "0"
End If
If Text45.Text = "" Then
Text45.Text = "0"
End If
If Text46.Text = "" Then
Text46.Text = "0"
End If
If Text47.Text = "" Then
Text47.Text = "0"
End If
a = Text43.Text
b = Text44.Text
f = Text45.Text
d = Text46.Text
e = Text47.Text
total = a + b + f + d + e
If Text9.Text = "" Then
Text9.Text = 0
End If
Text7.Text = total - Text9.Text
i = Text7.Text * 0.1
Text6.Text = i
Text7.Visible = True
Text6.Visible = True
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Cotización " & Text1.Text
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar la Cotización: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
End If
End Sub
Private Sub Form_Load()
'Label24.Visible = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Data1.Refresh
Data1.Recordset.MoveFirst
End Sub
Private Sub Guardar_Click()
If Text3.Text = "" Or Text4.Text = "" Or Text22.Text =
"" Or Text17.Text = "" Or Text27.Text = "" Or
Text19.Text = "" Or Text31.Text = "" Or Text21.Text =
"" Or Text32.Text = "" Or Text26.Text = "" Then
MsgBox "Debes llenar todos los Campos, Si ya no deseas Agregar otro Producto,
Llenar con ceros"
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from cotizacion")
rsinv.FindFirst ("no_cotizacion='" & Text1.Text & "'
")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe esa Cotizacion"
Text1.SetFocus
Else
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Command6.Enabled = True
Command5.Enabled = True
GuardarCambios.Enabled = False
Text9.Enabled = False
Text26.Enabled = False
Text32.Enabled = False
Text31.Enabled = False
Text21.Enabled = False
Text19.Enabled = False
Text27.Enabled = False
Text17.Enabled = False
Text22.Enabled = False
Text4.Enabled = False
Text3.Enabled = False
Text2.Enabled = False
Text1.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
Command9.Enabled = False
Command15.Enabled = False
Command6.Enabled = True
End If
End If
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Command6.Enabled = True
Text9.Enabled = False
Text26.Enabled = False
Text32.Enabled = False
Text31.Enabled = False
Text21.Enabled = False
Text19.Enabled = False
Text27.Enabled = False
Text17.Enabled = False
Text22.Enabled = False
Text4.Enabled = False
Text3.Enabled = False
Text2.Enabled = False
Text1.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
Command9.Enabled = False
Command15.Enabled = False
Command6.Enabled = True
End Sub
Private Sub Insertar_Click()
Command6.Enabled = False
Command9.Enabled = True
Command15.Enabled = True
Command1.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Text9.Enabled = True
Text26.Enabled = True
Text32.Enabled = True
Text31.Enabled = True
Text21.Enabled = True
Text19.Enabled = True
Text27.Enabled = True
Text17.Enabled = True
Text22.Enabled = True
Text4.Enabled = True
Text3.Enabled = True
Text2.Enabled = True
Text1.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Text5.Text = Date
Text9.Text = "0"
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Command8.Enabled = True
Insertar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Modificar_Click()
Command6.Enabled = False
Command9.Enabled = True
Command15.Enabled = True
Command1.Enabled = False
Cancelar.Enabled = True
Modificar.Enabled = False
Guardar.Enabled = False
Text9.Enabled = True
Text26.Enabled = True
Text32.Enabled = True
Text31.Enabled = True
Text21.Enabled = True
Text19.Enabled = True
Text27.Enabled = True
Text17.Enabled = True
Text22.Enabled = True
Text4.Enabled = True
Text3.Enabled = True
Text2.Enabled = True
Text1.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Command6.Enabled = False
Command8.Enabled = False
Command5.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Text17_Change()
If Text17.Text = "" Or Text17.Text = "0" Then
Text23.Text = " "
Text24.Text = " "
Text25.Text = ""
Text44.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No Existe ese Producto"
Else
p2 = Text17.Text
Text23.Text = rsinv1("nom_procucto")
Text24.Text = rsinv1("Existencia")
If Text24.Text = 0 Then
MsgBox "No puedes Cotizar Porque no Hay Existencia de Producto"
Text17.Text = ""
Text17.SetFocus
End If
Text25.Text = rsinv1("Costo_Unitario")
Text44.Text = Text25.Text * Int(Text22.Text)
Text23.Visible = True
Text24.Visible = True
Text25.Visible = True
Text44.Visible = True
End If
End If
End Sub
Private Sub Text19_Change()
If Text19.Text = "" Or Text19.Text = "0" Then
Text28.Text = " "
Text29.Text = " "
Text30.Text = ""
Text45.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe ese Producto"
Else
p3 = Text19.Text
Text28.Text = rsinv1("nom_procucto")
Text29.Text = rsinv1("Existencia")
If Text29.Text = 0 Then
MsgBox "No puedes Cotizar Porque no Hay Existencia de Producto"
Text19.Text = ""
Text19.SetFocus
End If
Text30.Text = rsinv1("Costo_Unitario")
Text45.Text = Text30.Text * Int(Text27.Text)
Text28.Visible = True
Text29.Visible = True
Text30.Visible = True
Text45.Visible = True
End If
End If
End Sub
Private Sub Text2_Change()
If Text2.Text = "" Or Text2.Text = "0" Then
Text10.Text = " "
Text11.Text = " "
Text12.Text = ""
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from clientes where no_cliente='"
& Text2.Text & "' ", dbOpenDynaset)
If rsinv.EOF Then
MsgBox "No Existe ese Cliente"
Else
Text10.Text = rsinv("nom_cliente")
Text11.Text = rsinv("dir_cliente")
Text12.Text = rsinv("tel_cliente")
End If
End If
End Sub
Private Sub Text21_Change()
If Text21.Text = "" Or Text21.Text = "0" Then
Text33.Text = " "
Text34.Text = " "
Text35.Text = ""
Text46.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe ese Producto"
Else
p4 = Text21.Text
Text33.Text = rsinv1("nom_procucto")
Text34.Text = rsinv1("Existencia")
If Text34.Text = 0 Then
MsgBox "No puedes Cotizar Porque no Hay Existencia de Producto"
Text21.Text = ""
Text21.SetFocus
End If
Text35.Text = rsinv1("Costo_Unitario")
Text46.Text = Text35.Text * Int(Text31.Text)
Text33.Visible = True
Text34.Visible = True
Text35.Visible = True
Text46.Visible = True
End If
End If
End Sub
Private Sub Text22_Change()
c2 = Text22.Text
End Sub
Private Sub Text26_Change()
If Text26.Text = "" Or Text26.Text = "0" Then
Text38.Text = " "
Text39.Text = " "
Text53.Text = ""
Text47.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe ese Producto"
Else
p5 = Text26.Text
Text38.Text = rsinv1("nom_procucto")
Text39.Text = rsinv1("Existencia")
If Text39.Text = 0 Then
MsgBox "No puedes Cotizar Porque no Hay Existencia de Producto"
Text26.Text = ""
Text26.SetFocus
End If
Text53.Text = rsinv1("Costo_Unitario")
Text47.Text = Text53.Text * Int(Text32.Text)
Text38.Visible = True
Text39.Visible = True
Text53.Visible = True
Text47.Visible = True
End If
End If
End Sub
Private Sub Text27_Change()
c3 = Text27.Text
End Sub
Private Sub Text3_Change()
c1 = Text3.Text
End Sub
Private Sub text31_Change()
c4 = Text31.Text
End Sub
Private Sub Text32_Change()
'c5 = Text32.Text
End Sub
Private Sub Text4_Change()
cant = Text3.Text
If Text4.Text = "" Or Text4.Text = "0" Then
Text14.Text = " "
Text15.Text = " "
Text16.Text = ""
Text43.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe ese Producto"
Else
Text14.Text = rsinv1("nom_procucto")
Text15.Text = rsinv1("Existencia")
If Text15.Text = 0 Then
MsgBox "No puedes Cotizar Porque no Hay Existencia de Producto"
Text4.Text = ""
Text4.SetFocus
End If
Text16.Text = rsinv1("Costo_Unitario")
Set bd2 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv2 = bd2.OpenRecordset("select * from cotizacion where no_producto1='"
& Text4.Text & "' ", dbOpenDynaset)
If c1 = "" Then
c1 = "1"
End If
Text43.Text = Int(Text16.Text) * c1
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
End If
End If
End Sub
Form9.frm
Dim bd As Database
Dim rsinv As Recordset
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd2 As Database
Dim rsinv2 As Recordset
Dim bd4 As Database
Dim rsinv4 As Recordset
Dim bd3 As Database
Dim rsinv3 As Recordset
Dim bd5 As Database
Dim rsinv5 As Recordset
Dim Y As Currency
Dim a As Currency
Dim b As Currency
Dim f As Currency
Dim d As Currency
Dim e As Currency
Dim i As Currency
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero de la Factura a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_factura Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro esa Factura")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text41.Enabled = False
Text51.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
End Sub
Private Sub datos(x As Integer)
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from cotizacion where no_cotizacion='"
& x & "' ", dbOpenDynaset)
Text2.Text = rsinv("cantidad1")
Text22.Text = rsinv("cantidad2")
Text27.Text = rsinv("cantidad3")
Text3.Text = rsinv("cantidad4")
Text31.Text = rsinv("cantidad5")
Text4.Text = rsinv("no_producto1")
Text17.Text = rsinv("no_producto2")
Text19.Text = rsinv("no_producto3")
Text21.Text = rsinv("no_producto4")
Text26.Text = rsinv("no_producto5")
End Sub
Private Sub Command1_Click()
Form18.Show
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Facturación " & Text1.Text
End Sub
Private Sub Form_Load()
If Text26.Text = "0" Then
Text26.Text = ""
End If
If Text31.Text = "0" Then
Text31.Text = ""
End If
If Text21.Text = "0" Then
Text21.Text = ""
End If
If Text3.Text = "0" Then
Text3.Text = ""
End If
If Text19.Text = "0" Then
Text19.Text = ""
End If
If Text27.Text = "0" Then
Text27.Text = ""
End If
If Text22.Text = "0" Then
Text22.Text = ""
End If
If Text17.Text = "0" Then
Text17.Text = ""
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Data1.Refresh
Data1.Recordset.MoveFirst
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text41.Enabled = False
Text51.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
End Sub
Private Sub Text17_Change()
If Text17.Text = "" Or Text17.Text = "0" Then
Text23.Text = " "
Text24.Text = " "
Text25.Text = ""
Text17.Text = ""
Text22.Text = ""
Text44.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
Text23.Text = rsinv1("nom_procucto")
Text24.Text = rsinv1("Existencia")
Text25.Text = rsinv1("Costo_Unitario")
Text23.Visible = True
Text24.Visible = True
Text25.Visible = True
Text44.Visible = True
End If
End Sub
Private Sub Text19_Change()
If Text19.Text = "" Or Text19.Text = "0" Then
Text28.Text = " "
Text29.Text = " "
Text30.Text = ""
Text45.Text = ""
Text27.Text = ""
Text19.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
Text28.Text = rsinv1("nom_procucto")
Text29.Text = rsinv1("Existencia")
Text30.Text = rsinv1("Costo_Unitario")
Text28.Visible = True
Text29.Visible = True
Text30.Visible = True
Text45.Visible = True
End If
End Sub
Private Sub Text2_Change()
c1 = Text2.Text
End Sub
Private Sub Text20_Change()
If Text20.Text = " " Or Text20.Text = "" Then
Text12.Text = " "
Text13.Text = " "
Text11.Text = ""
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from clientes where no_cliente='"
& Text20.Text & "' ", dbOpenDynaset)
Text11.Text = rsinv("nom_cliente")
Text13.Text = rsinv("dir_cliente")
Text12.Text = rsinv("tel_cliente")
Text11.Visible = True
Text13.Visible = True
Text12.Visible = True
End If
End Sub
Private Sub Text21_Change()
If Text21.Text = "" Or Text21.Text = "0" Then
Text33.Text = " "
Text34.Text = " "
Text35.Text = ""
Text46.Text = ""
Text21.Text = ""
Text3.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
Text33.Text = rsinv1("nom_procucto")
Text34.Text = rsinv1("Existencia")
Text35.Text = rsinv1("Costo_Unitario")
Text33.Visible = True
Text34.Visible = True
Text35.Visible = True
Text46.Visible = True
End If
End Sub
Private Sub Text22_Change()
If Text22.Text = "0" Then
Text17.Text = "0"
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
Else
Text17.Text = rsinv1("no_producto2")
End If
End If
End Sub
Private Sub Text26_Change()
If Text26.Text = "" Or Text26.Text = "0" Then
Text38.Text = " "
Text39.Text = " "
Text53.Text = ""
Text47.Text = ""
Text31.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
Text38.Text = rsinv1("nom_procucto")
Text39.Text = rsinv1("Existencia")
Text53.Text = rsinv1("Costo_Unitario")
Text38.Visible = True
Text39.Visible = True
Text53.Visible = True
Text47.Visible = True
End If
End Sub
Private Sub Text4_Change()
If Text4.Text = "0" Or Text4.Text = "" Then
Text14.Text = " "
Text15.Text = " "
Text16.Text = ""
Text43.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
Text14.Text = rsinv1("nom_procucto")
Text15.Text = rsinv1("Existencia")
Text16.Text = rsinv1("Costo_Unitario")
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
End If
End Sub
Private Sub text41_change()
If Text41.Text = "0" Or Text41.Text = "" Then
Text20.Text = " "
Text2.Text = " "
Text22.Text = ""
Text27.Text = ""
Text3.Text = ""
Text31.Text = ""
Text4.Text = ""
Text17.Text = ""
Text19.Text = ""
Text21.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe esa Cotizacion"
Else
Text20.Text = rsinv1("no_cliente")
Text6.Text = rsinv1("importe")
Text9.Text = rsinv1("descuento")
Text18.Text = rsinv1("sub-toal")
Text8.Text = rsinv1("iva")
Text43.Text = rsinv1("importe1")
Text44.Text = rsinv1("importe2")
Text45.Text = rsinv1("importe3")
Text46.Text = rsinv1("importe4")
Text47.Text = rsinv1("importe5")
x = Text41.Text
datos (x)
'Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
'Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
'Text14.Text = rsinv1("nom_procucto")
'Text15.Text = rsinv1("Existencia")
'Text16.Text = rsinv1("Costo_Unitario")
'Text43.Text = Int(Text16.Text) * Int(Text3.Text)
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
Text9.Visible = True
Text20.Visible = True
Text2.Visible = True
Text22.Visible = True
Text27.Visible = True
Text3.Visible = True
Text31.Visible = True
Text4.Visible = True
Text17.Visible = True
Text19.Visible = True
Text21.Visible = True
Text26.Visible = True
End If
End If
End Sub
Private Sub Command5_Click()
Form2.Show
Form9.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar la Factura: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
End If
End Sub
Private Sub Guardar_Click()
If Text1.Text = "" Or Text41.Text = "" Or Text51.Text
= "" Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from factura")
rsinv.FindFirst ("no_factura='" & Text1.Text & "' ")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe esa Factura"
Text1.SetFocus
Else
If Text4.Text <> "0" Then
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
rsinv1.Edit
x = rsinv1("Existencia")
rsinv1("Existencia") = x - Int(Text2.Text)
rsinv1.Update
'risnv1.Close
End If
If Text17.Text <> "" Then
Set bd2 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv2 = bd2.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
rsinv2.Edit
x = rsinv2("Existencia")
rsinv2("Existencia") = x - Int(Text22.Text)
rsinv2.Update
'risnv2.Close
End If
If Text19.Text <> "" Then
Set bd3 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv3 = bd3.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
rsinv3.Edit
x = rsinv3("Existencia")
rsinv3("Existencia") = x - Int(Text27.Text)
rsinv3.Update
'risnv3.Close
End If
If Text21.Text <> "" Then
Set bd4 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv4 = bd4.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
rsinv4.Edit
x = rsinv4("Existencia")
rsinv4("Existencia") = x - Int(Text3.Text)
rsinv4.Update
'risnv4.Close
End If
If Text26.Text <> "" Then
Set bd5 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv5 = bd5.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
rsinv5.Edit
x = rsinv5("Existencia")
rsinv5("Existencia") = x - Int(Text31.Text)
rsinv5.Update
'risnv5.Close
End If
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Text1.Enabled = False
Text41.Enabled = False
Text51.Enabled = False
Data1.Enabled = True
Command1.Enabled = True
End If
End If
End Sub
Private Sub Insertar_Click()
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.Enabled = True
Text41.Enabled = True
Text51.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Text5.Text = Date
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Insertar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = False
Data1.Enabled = False
Command1.Enabled = False
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text41.Enabled = True
Text51.Enabled = True
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
Data1.Enabled = False
Command1.Enabled = False
End Sub
Private Sub Text51_Change()
If Text51.Text = "" Or Text51.Text = "0" Then
Text49.Text = " "
Else
Set bd4 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv4 = bd4.OpenRecordset("select * from vendedores where no_vendedor='"
& Text51.Text & "' ", dbOpenDynaset)
If rsinv4.EOF Then
MsgBox "No existe ese Vendedor"
Else
Text49.Text = rsinv4("nom_vendedor")
End If
End If
End Sub
Form10.frm
Private Sub Command1_Click()
Form2.Show
Form10.Visible = False
Unload Me
End Sub
Private Sub Form_Load()
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
End Sub
Form11.frm
Dim bd As Database
Dim rsinv As Recordset
Dim x As Integer
Private Sub Buscar_Click()
Dim Buscar As String
Buscar = InputBox("Numero del Producto a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "No_Producto Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro ese Producto")
End If
End Sub
Private Sub Command5_Click()
Form2.Show
Form11.Visible = False
Data1.Refresh
Data1.Recordset.MoveFirst
Unload Me
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Producto " & Text1.Text
End Sub
Private Sub Eliminar_Click()
x = Text4.Text
Text4.Text = x - 1
Data1.Recordset.Edit
Data1.Recordset.Update
End Sub
Private Sub Form_Unload(Cancel As Integer)
Data1.Refresh
End Sub
Private Sub Insertar_Click()
x = Text4.Text
Text4.Text = x + 1
Data1.Recordset.Edit
Data1.Recordset.Update
End Sub
Private Sub Modificar_Click()
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
End Sub
Form12.frm
Option Explicit
Dim bd As Database
'Dim wps As Workspace
Dim rsinv As Recordset
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd2 As Database
Dim rsinv2 As Recordset
Dim x As Integer
Dim Y As Integer
Private Sub Buscar_Click()
Dim Buscar As String
Dim Criterio As String
Buscar = InputBox("Numero de la Compra a Buscar: ")
If Buscar = " " Then Exit Sub
Criterio = "no_compra Like '*" & Buscar & "*'"
Data1.Recordset.MoveNext
If Not Data1.Recordset.EOF Then
Data1.Recordset.FindFirst Criterio
End If
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Data1.Recordset.FindFirst Criterio
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
If Data1.Recordset.NoMatch = True Then
MsgBox ("No se Encontro esa Compra")
End If
End Sub
Private Sub Cancelar_Click()
Data1.Recordset.CancelUpdate
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Command1.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
End Sub
Private Sub Command1_Click()
x = Text4.Text * Text8.Text
Y = x * 0.1
Text6.Text = Y + x
End Sub
Private Sub GuardarCambios_Click()
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Data1.Refresh
Command1.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Command5.Enabled = True
GuardarCambios.Enabled = False
Data1.Enabled = True
End Sub
Private Sub Command5_Click()
Form2.Show
Form12.Visible = False
Unload Me
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "Compra " & Text1.Text
'Data1.Caption = "Compra " & (Data1.Recordset.AbsolutePosition
+ 1)
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar la Compra: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
End If
End Sub
Private Sub Form_Load()
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
'bd.Close
End Sub
Private Sub Guardar_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text =
"" Or Text4.Text = "" Or Text8.Text = "" Or
Text6.Text = "" Then
MsgBox "Debes llenar todos los Campos"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from compra")
rsinv.FindFirst ("no_compra='" & Text1.Text & "' ")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe esa Compra"
Text1.SetFocus
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from Producto where No_Producto='"
& Text3.Text & "' ", dbOpenDynaset)
rsinv.Edit
x = rsinv("Existencia")
rsinv("Existencia") = x + Text4.Text
rsinv.Update
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
Data1.Refresh
Command1.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Command5.Enabled = True
Data1.Enabled = True
End If
End If
End Sub
Private Sub Insertar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Command1.Enabled = True
Insertar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Text5.Text = Date
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
GuardarCambios.Enabled = False
Command5.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Modificar_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Modificar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
Data1.Enabled = False
End Sub
Private Sub Text2_Change()
If Text2.Text = "" Or Text2.Text = "0" Then
Text14.Text = " "
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from proveedores where no_proveedor='"
& Text2.Text & "'") ', dbOpenDynaset)
If rsinv.EOF Then
MsgBox "No existe ese Proveedor"
Else
Text14.Text = rsinv("nom_prov")
End If
rsinv.Close
End If
End Sub
Private Sub Text3_Change()
Dim sql As String
If Text3.Text = "" Or Text3.Text = "0" Then
Text13.Text = " "
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
sql = "select * from producto where No_Producto='" & Text3.Text
& "'"
'MsgBox sql
Set rsinv1 = bd1.OpenRecordset(sql)
If rsinv1.EOF Then
MsgBox "No existe ese Producto"
Else
Text13.Text = rsinv1("Nom_Procucto")
Text8.Text = rsinv1("Costo_Unitario")
End If
End If
End Sub
Form13.frm
Dim Report As New CrystalReport1
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form14.frm
Dim Report As New CrystalReport2
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form15.frm
Dim Report As New CrystalReport3
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form16.frm
Dim Report As New CrystalReport4
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form17.frm
Dim Report As New CrystalReport5
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form18.frm
Dim bd As Database
Dim rsinv As Recordset
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd2 As Database
Dim rsinv2 As Recordset
Dim bd4 As Database
Dim rsinv4 As Recordset
Dim bd3 As Database
Dim rsinv3 As Recordset
Dim bd5 As Database
Dim rsinv5 As Recordset
Dim Y As Currency
Dim a As Currency
Dim b As Currency
Dim f As Currency
Dim d As Currency
Dim e As Currency
Dim i As Currency
Private Sub datos(x As Integer)
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from cotizacion where no_cotizacion='"
& x & "' ", dbOpenDynaset)
Text2.Text = rsinv("cantidad1")
Text22.Text = rsinv("cantidad2")
Text27.Text = rsinv("cantidad3")
Text3.Text = rsinv("cantidad4")
Text31.Text = rsinv("cantidad5")
Text4.Text = rsinv("no_producto1")
Text17.Text = rsinv("no_producto2")
Text19.Text = rsinv("no_producto3")
Text21.Text = rsinv("no_producto4")
Text26.Text = rsinv("no_producto5")
End Sub
Private Sub Command1_Click()
Form18.Show
End Sub
Private Sub Form_Load()
Text41.Text = Form9.Text41.Text
Text1.Text = Form9.Text1.Text
Text51.Text = Form9.Text51.Text
Text5.Text = Form9.Text5.Text
If Text26.Text = "0" Then
Text26.Text = ""
End If
If Text31.Text = "0" Then
Text31.Text = ""
End If
If Text21.Text = "0" Then
Text21.Text = ""
End If
If Text3.Text = "0" Then
Text3.Text = ""
End If
If Text19.Text = "0" Then
Text19.Text = ""
End If
If Text27.Text = "0" Then
Text27.Text = ""
End If
If Text22.Text = "0" Then
Text22.Text = ""
End If
If Text17.Text = "0" Then
Text17.Text = ""
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Text41.Text = ""
Text1.Text = ""
Text51.Text = ""
End Sub
Private Sub GuardarCambios_Click()
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Guardar.Enabled = False
Cancelar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
End Sub
Private Sub Text17_Change()
If Text17.Text = "" Or Text17.Text = "0" Then
Text23.Text = " "
Text24.Text = " "
Text25.Text = ""
Text17.Text = ""
Text22.Text = ""
Text44.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
Text23.Text = rsinv1("nom_procucto")
Text24.Text = rsinv1("Existencia")
Text25.Text = rsinv1("Costo_Unitario")
Text23.Visible = True
Text24.Visible = True
Text25.Visible = True
Text44.Visible = True
End If
End Sub
Private Sub Text19_Change()
If Text19.Text = "" Or Text19.Text = "0" Then
Text28.Text = " "
Text29.Text = " "
Text30.Text = ""
Text45.Text = ""
Text27.Text = ""
Text19.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
Text28.Text = rsinv1("nom_procucto")
Text29.Text = rsinv1("Existencia")
Text30.Text = rsinv1("Costo_Unitario")
Text28.Visible = True
Text29.Visible = True
Text30.Visible = True
Text45.Visible = True
End If
End Sub
Private Sub Text2_Change()
c1 = Text2.Text
End Sub
Private Sub Text20_Change()
If Text20.Text = " " Or Text20.Text = "" Then
Text12.Text = " "
Text13.Text = " "
Text11.Text = ""
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from clientes where no_cliente='"
& Text20.Text & "' ", dbOpenDynaset)
Text11.Text = rsinv("nom_cliente")
Text13.Text = rsinv("dir_cliente")
Text12.Text = rsinv("tel_cliente")
Text11.Visible = True
Text13.Visible = True
Text12.Visible = True
End If
End Sub
Private Sub Text21_Change()
If Text21.Text = "" Or Text21.Text = "0" Then
Text33.Text = " "
Text34.Text = " "
Text35.Text = ""
Text46.Text = ""
Text21.Text = ""
Text3.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
Text33.Text = rsinv1("nom_procucto")
Text34.Text = rsinv1("Existencia")
Text35.Text = rsinv1("Costo_Unitario")
Text33.Visible = True
Text34.Visible = True
Text35.Visible = True
Text46.Visible = True
End If
End Sub
Private Sub Text22_Change()
If Text22.Text = "0" Then
Text17.Text = "0"
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
Else
Text17.Text = rsinv1("no_producto2")
End If
End If
End Sub
Private Sub Text26_Change()
If Text26.Text = "" Or Text26.Text = "0" Then
Text38.Text = " "
Text39.Text = " "
Text53.Text = ""
Text47.Text = ""
Text31.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
Text38.Text = rsinv1("nom_procucto")
Text39.Text = rsinv1("Existencia")
Text53.Text = rsinv1("Costo_Unitario")
Text38.Visible = True
Text39.Visible = True
Text53.Visible = True
Text47.Visible = True
End If
End Sub
Private Sub Text4_Change()
If Text4.Text = "0" Or Text4.Text = "" Then
Text14.Text = " "
Text15.Text = " "
Text16.Text = ""
Text43.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
Text14.Text = rsinv1("nom_procucto")
Text15.Text = rsinv1("Existencia")
Text16.Text = rsinv1("Costo_Unitario")
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
End If
End Sub
Private Sub text41_change()
If Text41.Text = "0" Or Text41.Text = "" Then
Text20.Text = " "
Text2.Text = " "
Text22.Text = ""
Text27.Text = ""
Text3.Text = ""
Text31.Text = ""
Text4.Text = ""
Text17.Text = ""
Text19.Text = ""
Text21.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe esa Cotizacion"
Else
Text20.Text = rsinv1("no_cliente")
Text18.Text = rsinv1("importe")
Text9.Text = rsinv1("descuento")
Text7.Text = rsinv1("sub-toal")
Text8.Text = rsinv1("iva")
Text43.Text = rsinv1("importe1")
Text44.Text = rsinv1("importe2")
Text45.Text = rsinv1("importe3")
Text46.Text = rsinv1("importe4")
Text47.Text = rsinv1("importe5")
x = Text41.Text
datos (x)
'Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
'Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
'Text14.Text = rsinv1("nom_procucto")
'Text15.Text = rsinv1("Existencia")
'Text16.Text = rsinv1("Costo_Unitario")
'Text43.Text = Int(Text16.Text) * Int(Text3.Text)
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
Text9.Visible = True
Text20.Visible = True
Text2.Visible = True
Text22.Visible = True
Text27.Visible = True
Text3.Visible = True
Text31.Visible = True
Text4.Visible = True
Text17.Visible = True
Text19.Visible = True
Text21.Visible = True
Text26.Visible = True
End If
End If
End Sub
Private Sub Command5_Click()
Form2.Show
Form9.Visible = False
Unload Me
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar la Factura: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
End If
End Sub
Private Sub Guardar_Click()
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from factura")
rsinv.FindFirst ("no_factura='" & Text1.Text & "' ")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe esa Factura"
Text1.SetFocus
Else
If Text4.Text <> "0" Then
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
rsinv1.Edit
x = rsinv1("Existencia")
rsinv1("Existencia") = x - Int(Text2.Text)
rsinv1.Update
'risnv1.Close
End If
If Text17.Text <> "0" Then
Set bd2 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv2 = bd2.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
rsinv2.Edit
x = rsinv2("Existencia")
rsinv2("Existencia") = x - Int(Text22.Text)
rsinv2.Update
'risnv2.Close
End If
If Text19.Text <> "0" Then
Set bd3 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv3 = bd3.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
rsinv3.Edit
x = rsinv3("Existencia")
rsinv3("Existencia") = x - Int(Text27.Text)
rsinv3.Update
'risnv3.Close
End If
If Text21.Text <> "0" Then
Set bd4 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv4 = bd4.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
rsinv4.Edit
x = rsinv4("Existencia")
rsinv4("Existencia") = x - Int(Text3.Text)
rsinv4.Update
'risnv4.Close
End If
If Text26.Text <> "0" Then
Set bd5 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv5 = bd5.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
rsinv5.Edit
x = rsinv5("Existencia")
rsinv5("Existencia") = x - Int(Text31.Text)
rsinv5.Update
'risnv5.Close
End If
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
End If
End Sub
Private Sub Insertar_Click()
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Text5.Text = Date
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Insertar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = False
End Sub
Private Sub Modificar_Click()
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
End Sub
Private Sub Text51_Change()
If Text51.Text = "" Or Text51.Text = "0" Then
Text49.Text = " "
Else
Set bd4 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv4 = bd4.OpenRecordset("select * from vendedores where no_vendedor='"
& Text51.Text & "' ", dbOpenDynaset)
If rsinv4.EOF Then
MsgBox "No existe ese Vendedor"
Else
Text49.Text = rsinv4("nom_vendedor")
End If
End If
End Sub
Private Sub Timer1_Timer()
Unload Me
Form9.Show
End Sub
Form19.frm
Dim bd As Database
Dim rsinv As Recordset
Dim bd1 As Database
Dim rsinv1 As Recordset
Dim bd2 As Database
Dim rsinv2 As Recordset
Dim bd4 As Database
Dim rsinv4 As Recordset
Dim bd3 As Database
Dim rsinv3 As Recordset
Dim bd5 As Database
Dim rsinv5 As Recordset
Dim Y As Currency
Dim a As Currency
Dim b As Currency
Dim f As Currency
Dim d As Currency
Dim e As Currency
Dim i As Currency
Private Sub datos(x As Integer)
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from cotizacion where no_cotizacion='"
& x & "' ", dbOpenDynaset)
Text2.Text = rsinv("cantidad1")
Text22.Text = rsinv("cantidad2")
Text27.Text = rsinv("cantidad3")
Text3.Text = rsinv("cantidad4")
Text31.Text = rsinv("cantidad5")
Text4.Text = rsinv("no_producto1")
Text17.Text = rsinv("no_producto2")
Text19.Text = rsinv("no_producto3")
Text21.Text = rsinv("no_producto4")
Text26.Text = rsinv("no_producto5")
End Sub
Private Sub Command1_Click()
Form18.Show
End Sub
Private Sub Form_Load()
Text41.Text = Form8.Text1.Text
Text5.Text = Form8.Text5.Text
Text20.Text = Form8.Text2.Text
If Text26.Text = "0" Then
Text26.Text = ""
End If
If Text31.Text = "0" Then
Text31.Text = ""
End If
If Text21.Text = "0" Then
Text21.Text = ""
End If
If Text3.Text = "0" Then
Text3.Text = ""
End If
If Text19.Text = "0" Then
Text19.Text = ""
End If
If Text27.Text = "0" Then
Text27.Text = ""
End If
If Text22.Text = "0" Then
Text22.Text = ""
End If
If Text17.Text = "0" Then
Text17.Text = ""
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Text41.Text = ""
Text20.Text = ""
End Sub
Private Sub Text17_Change()
If Text17.Text = "" Or Text17.Text = "0" Then
Text23.Text = " "
Text24.Text = " "
Text25.Text = ""
Text17.Text = ""
Text22.Text = ""
Text44.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
Text23.Text = rsinv1("nom_procucto")
Text24.Text = rsinv1("Existencia")
Text25.Text = rsinv1("Costo_Unitario")
Text23.Visible = True
Text24.Visible = True
Text25.Visible = True
Text44.Visible = True
End If
End Sub
Private Sub Text19_Change()
If Text19.Text = "" Or Text19.Text = "0" Then
Text28.Text = " "
Text29.Text = " "
Text30.Text = ""
Text45.Text = ""
Text27.Text = ""
Text19.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
Text28.Text = rsinv1("nom_procucto")
Text29.Text = rsinv1("Existencia")
Text30.Text = rsinv1("Costo_Unitario")
Text28.Visible = True
Text29.Visible = True
Text30.Visible = True
Text45.Visible = True
End If
End Sub
Private Sub Text2_Change()
c1 = Text2.Text
End Sub
Private Sub Text20_Change()
If Text20.Text = " " Or Text20.Text = "" Then
Text12.Text = " "
Text13.Text = " "
Text11.Text = ""
Else
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from clientes where no_cliente='"
& Text20.Text & "' ", dbOpenDynaset)
Text11.Text = rsinv("nom_cliente")
Text13.Text = rsinv("dir_cliente")
Text12.Text = rsinv("tel_cliente")
Text11.Visible = True
Text13.Visible = True
Text12.Visible = True
End If
End Sub
Private Sub Text21_Change()
If Text21.Text = "" Or Text21.Text = "0" Then
Text33.Text = " "
Text34.Text = " "
Text35.Text = ""
Text46.Text = ""
Text21.Text = ""
Text3.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
Text33.Text = rsinv1("nom_procucto")
Text34.Text = rsinv1("Existencia")
Text35.Text = rsinv1("Costo_Unitario")
Text33.Visible = True
Text34.Visible = True
Text35.Visible = True
Text46.Visible = True
End If
End Sub
Private Sub Text22_Change()
If Text22.Text = "0" Then
Text17.Text = "0"
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
Else
Text17.Text = rsinv1("no_producto2")
End If
End If
End Sub
Private Sub Text26_Change()
If Text26.Text = "" Or Text26.Text = "0" Then
Text38.Text = " "
Text39.Text = " "
Text53.Text = ""
Text47.Text = ""
Text31.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
Text38.Text = rsinv1("nom_procucto")
Text39.Text = rsinv1("Existencia")
Text53.Text = rsinv1("Costo_Unitario")
Text38.Visible = True
Text39.Visible = True
Text53.Visible = True
Text47.Visible = True
End If
End Sub
Private Sub Text4_Change()
If Text4.Text = "0" Or Text4.Text = "" Then
Text14.Text = " "
Text15.Text = " "
Text16.Text = ""
Text43.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
Text14.Text = rsinv1("nom_procucto")
Text15.Text = rsinv1("Existencia")
Text16.Text = rsinv1("Costo_Unitario")
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
End If
End Sub
Private Sub text41_change()
If Text41.Text = "0" Or Text41.Text = ""
Then
Text20.Text = " "
Text2.Text = " "
Text22.Text = ""
Text27.Text = ""
Text3.Text = ""
Text31.Text = ""
Text4.Text = ""
Text17.Text = ""
Text19.Text = ""
Text21.Text = ""
Text26.Text = ""
Else
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from cotizacion where no_cotizacion='"
& Text41.Text & "' ", dbOpenDynaset)
If rsinv1.EOF Then
MsgBox "No existe esa Cotizacion"
Else
Text20.Text = rsinv1("no_cliente")
Text18.Text = rsinv1("importe")
Text9.Text = rsinv1("descuento")
Text7.Text = rsinv1("sub-toal")
Text8.Text = rsinv1("iva")
Text43.Text = rsinv1("importe1")
Text44.Text = rsinv1("importe2")
Text45.Text = rsinv1("importe3")
Text46.Text = rsinv1("importe4")
Text47.Text = rsinv1("importe5")
x = Text41.Text
datos (x)
'Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
'Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
'Text14.Text = rsinv1("nom_procucto")
'Text15.Text = rsinv1("Existencia")
'Text16.Text = rsinv1("Costo_Unitario")
'Text43.Text = Int(Text16.Text) * Int(Text3.Text)
Text14.Visible = True
Text15.Visible = True
Text16.Visible = True
Text43.Visible = True
Text9.Visible = True
Text20.Visible = True
Text2.Visible = True
Text22.Visible = True
Text27.Visible = True
Text3.Visible = True
Text31.Visible = True
Text4.Visible = True
Text17.Visible = True
Text19.Visible = True
Text21.Visible = True
Text26.Visible = True
End If
End If
End Sub
Private Sub Command5_Click()
Form2.Show
Form9.Visible = False
Unload Me
End Sub
Private Sub Eliminar_Click()
Dim r As Integer
r = MsgBox("Desea Borrar la Factura: ", vbYesNo, "Eliminar")
If r = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If Data1.Recordset.EOF Then
End If
End Sub
Private Sub Guardar_Click()
Set bd = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv = bd.OpenRecordset("select * from factura")
rsinv.FindFirst ("no_factura='" & Text1.Text & "' ")
If rsinv.NoMatch = False Then
MsgBox "Ya Existe esa Factura"
Text1.SetFocus
Else
If Text4.Text <> "0" Then
Set bd1 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv1 = bd1.OpenRecordset("select * from Producto where No_Producto='"
& Text4.Text & "' ", dbOpenDynaset)
rsinv1.Edit
x = rsinv1("Existencia")
rsinv1("Existencia") = x - Int(Text2.Text)
rsinv1.Update
'risnv1.Close
End If
If Text17.Text <> "0" Then
Set bd2 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv2 = bd2.OpenRecordset("select * from Producto where No_Producto='"
& Text17.Text & "' ", dbOpenDynaset)
rsinv2.Edit
x = rsinv2("Existencia")
rsinv2("Existencia") = x - Int(Text22.Text)
rsinv2.Update
'risnv2.Close
End If
If Text19.Text <> "0" Then
Set bd3 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv3 = bd3.OpenRecordset("select * from Producto where No_Producto='"
& Text19.Text & "' ", dbOpenDynaset)
rsinv3.Edit
x = rsinv3("Existencia")
rsinv3("Existencia") = x - Int(Text27.Text)
rsinv3.Update
'risnv3.Close
End If
If Text21.Text <> "0" Then
Set bd4 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv4 = bd4.OpenRecordset("select * from Producto where No_Producto='"
& Text21.Text & "' ", dbOpenDynaset)
rsinv4.Edit
x = rsinv4("Existencia")
rsinv4("Existencia") = x - Int(Text3.Text)
rsinv4.Update
'risnv4.Close
End If
If Text26.Text <> "0" Then
Set bd5 = OpenDatabase("C:\Balasys\Master Electrica.mdb")
Set rsinv5 = bd5.OpenRecordset("select * from Producto where No_Producto='"
& Text26.Text & "' ", dbOpenDynaset)
rsinv5.Edit
x = rsinv5("Existencia")
rsinv5("Existencia") = x - Int(Text31.Text)
rsinv5.Update
'risnv5.Close
End If
Data1.Recordset.Update
Data1.Recordset.MoveFirst
Insertar.Enabled = True
Modificar.Enabled = True
Buscar.Enabled = True
Eliminar.Enabled = True
Cancelar.Enabled = False
Guardar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = True
End If
End Sub
Private Sub Insertar_Click()
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.AddNew
Text5.Text = Date
Modificar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = True
Insertar.Enabled = False
GuardarCambios.Enabled = False
Command5.Enabled = False
End Sub
Private Sub Modificar_Click()
Cancelar.Enabled = True
Guardar.Enabled = True
Text1.SetFocus
Data1.Recordset.Edit
Insertar.Enabled = False
Buscar.Enabled = False
Eliminar.Enabled = False
Cancelar.Enabled = True
Guardar.Enabled = False
GuardarCambios.Enabled = True
Command5.Enabled = False
End Sub
Private Sub Timer1_Timer()
Unload Me
Form8.Show
End Sub
Form20.frm
Dim Report As New CrystalReport6
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form21.frm
Dim Report As New CrystalReport7
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Form22.frm
Dim Report As New CrystalReport8
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Caducidad de Archivos:
Legalmente se debe guardar toda la información por 5 años, por lo que se recomienda guardar los archivos de la base de datos del sistema.
Respaldos:
El sistema no cuenta con una opción de respaldo de la información, por lo que se recomienda respaldar la base de datos del sistema en cd o diskette, minimo cada semana, para evitar cualquier perdida de información.
Distribución de Resultados:
Documento |
Dirigido a: |
| Factura | Cliente |
| Cotización | Cliente |
| Reporte de Productos | Gerente de Ventas de la Empresa |
| Reporte de Clientes | Gerente de Ventas de la Empresa |
| Reporte de Proveedores | Gerente de Ventas de la Empresa |
| Reporte de Vendedores | Gerente de Ventas de la Empresa |
| Reporte de Inventario | Gerente de Ventas de la Empresa |
| Reporte de Compras | Gerente de Ventas de la Empresa |
| Reporte de Facturas | Gerente de Ventas de la Empresa |
| Reporte de Cotizaciones | Gerente de Ventas de la Empresa |