You are on page 1of 17

ALUMNOS DE INFORMATICA

ADMINISTRATIVA
MANUAL DE USO DEL SISTEMA

2010

EL MANUAL DE USO DEL SISTEMA ES UN METODO PARA DAR A


CONOCER LOS PUNTOS MÁS COMPLEJOS DE COMO ESTA
ESTRUCTURADO EL PROYECTO PARA QUE LOS NUEVOS USUARIOS
ESTEN IDENTIFICADOS CON CADA UNA DE LAS FUNCIONES QUE
REALIZA EL PROGRAMA.

INTEGRANTES
DENNIS CABRERA LECHUGA
GERARDO MELENDEZ FIDEL
LETICIA CRUZ CARBALLO

MUEBLERIA BUDDY
764 767 16 25
http:\\muebleria-buddy.blogspot.com
INGENIERIA DEL SOFTWARE

M A N U A L DE S I S T E M A
MUEBLERIA BUDDY

PANTALLA DE INICIO

Ilustración 1

Private Sub Command1_Click() End If Form2.cmdcredito.Visible =


If Text1.Text <> "" Then False
Tira = "Select * From Tabla1" If rs(4) = "1" Then End If
Set rs = Form2.cmdsalidas.Visible =
BaseDatos.OpenRecordset(Tira) True If rs(8) = "1" Then
With rs Else Form2.nuevo.Visible = True
.FindFirst "Usuario ='" & Form2.cmdsalidas.Visible = Else
Text1.Text & "'" False Form2.nuevo.Visible = False
End If End If
If .NoMatch Then
MsgBox ("Este usuario no esta If rs(5) = "1" Then If rs(9) = "1" Then
registrado en las bases de datos"), Form2.cmdinventario.Visible =
vbInformation, "MUEBLERIA True Form2.cliente_modificar2.Enabled
BUDDY" Else = True
Else Form2.cmdinventario.Visible = Else
False
If rs(2) = "1" Then End If Form2.cliente_modificar2.Enabled
Form2.cmdnuevo.Visible = = False
True If rs(6) = "1" Then End If
Else Form2.cmdmodificar.Visible =
Form2.cmdnuevo.Visible = True If rs(10) = "1" Then
False Else Form2.usuario.Enabled =
End If Form2.cmdmodificar.Visible = True
False Else
If rs(3) = "1" Then End If Form2.usuario.Enabled =
Form2.cmdentradas.Visible = False
True If rs(7) = "1" Then End If
Else Form2.cmdcredito.Visible =
Form2.cmdentradas.Visible = True If rs(11) = "1" Then
False Else

MUEBLERIA BUDDY Página 2


INGENIERIA DEL SOFTWARE

If rs(2) = "1" Then


Form2.reg_movimientos.Visible = Form2.cmdnuevo.Visible = Form2.cliente_modificar2.Enabled
True True = False
Else Else End If
Form2.cmdnuevo.Visible =
Form2.reg_movimientos.Visible = False If rs(10) = "1" Then
False End If Form2.usuario.Enabled =
End If True
inicial.Show If rs(3) = "1" Then Else
Form2.cmdentradas.Visible = Form2.usuario.Enabled =
If rs(12) = "1" Then True False
Form2.cmdpagos.Visible = Else End If
True Form2.cmdentradas.Visible =
Else False If rs(11) = "1" Then
Form2.cmdpagos.Visible = End If
False Form2.reg_movimientos.Visible =
End If If rs(4) = "1" Then True
inicial.Show Form2.cmdsalidas.Visible = Else
True
Unload Me Else Form2.reg_movimientos.Visible =
Form2.cmdsalidas.Visible = False
End If False End If
End With End If inicial.Show
Else
MsgBox ("INGRESAR If rs(5) = "1" Then If rs(12) = "1" Then
USURIO"), vbInformation, Form2.cmdinventario.Visible = Form2.cmdpagos.Visible =
"MUEBLERIA BUDDY" True True
Text1.SetFocus Else Else
End If Form2.cmdinventario.Visible = Form2.cmdpagos.Visible =
End Sub False False
End If End If
Private Sub Form_Load()
Direccion = App.Path & If rs(6) = "1" Then If rs(13) = "1" Then
"\bd_data.mdb" Form2.cmdmodificar.Visible = Form2.reg_entrantes.Visible =
Set BaseDatos = True True
OpenDatabase(Direccion) Else Else
Form2.cmdmodificar.Visible = Form2.reg_entrantes.Visible =
End Sub False False
End If End If
Private Sub
Text1_KeyPress(KeyAscii As If rs(7) = "1" Then
Integer) Form2.cmdcredito.Visible = inicial.Show
If KeyAscii = 13 Then True
Else Unload Me
Form2.cmdcredito.Visible =
If Text1.Text <> "" Then False End If
Tira = "Select * From Tabla1" End If End With
Set rs = Else
BaseDatos.OpenRecordset(Tira) If rs(8) = "1" Then MsgBox ("INGRESAR
With rs Form2.nuevo.Visible = True USUARIO"), vbInformation,
.FindFirst "Usuario ='" & Else "MUEBLERIA BUDDY"
Text1.Text & "'" Form2.nuevo.Visible = False Text1.SetFocus
End If End If
If .NoMatch Then
MsgBox ("Este usuario no esta If rs(9) = "1" Then
registrado en las bases de datos"),
vbInformation, "MUEBLERIA Form2.cliente_modificar2.Enabled End If
BUDDY" = True
Else Else End Sub

MUEBLERIA BUDDY Página 3


INGENIERIA DEL SOFTWARE

Pantalla: inicial

Ilustración 2

Private Sub Form_Load()


ShockwaveFlash1.Movie = App.Path & "\ani.swf"
End Sub

Private Sub Movie1_GotFocus()


End Sub

Private Sub Timer1_Timer()


If Timer1.Interval = 3000 Then
Unload Me
Form2.Show
End If
End Sub

Pantalla: Principal

Ilustración 3

Dim x, Y, xt, wt As Integer Option Explicit End Sub


Dim accion As String Private Sub
Dim abrir As String cambio_usuario_Click() Private Sub
Public ope As Integer contra.Show cliente_modificar2_Click()
Public opcion As Integer Unload Me mod_cliente.Show

MUEBLERIA BUDDY Página 4


INGENIERIA DEL SOFTWARE

End Sub If Text1 <> "" Then Set DataGrid1.DataSource =


.Recordset.Filter = Adodc1.Recordset
Private Sub cmdcredito_Click() Combo1 & " LIKE '*" + Text1 + "*'" DataGrid1.MarqueeStyle =
creditos.Show Set DataGrid1.DataSource dbgHighlightRowRaiseCell
End Sub = Adodc1.Recordset
.Visible = False
Private Sub cmdentradas_Click() Else End With
agregar.Show .Recordset.Filter = ""
End Sub End If
.Refresh On Error GoTo error_Handler
Private Sub cmdinventario_Click() End With With Adodc1
inventario.Show Exit Sub If Text1 <> "" Then
End Sub If Err.Number = 3265 Then .Recordset.Filter =
MsgBox "ERROR", vbCritical, Combo1 & " LIKE '*" + Text1 + "*'"
Private Sub cmdmodificar_Click() "MUEBLERIA BUDDY" Set DataGrid1.DataSource
modificar.Show Else = Adodc1.Recordset
End Sub MsgBox Err.Description,
vbCritical, "MUEBLERIA BUDDY" Else
Private Sub cmdnuevo_Click() End If .Recordset.Filter = ""
entradas.Show End If
End Sub .Refresh
End With
Private Sub cmdpagos_Click() Exit Sub
ope = 1 error_Handler:
opcion = 0 If Error.Number = 3265 Then
pagos.Show End Sub MsgBox "el campo
End Sub seleccionado no es válido",
Private Sub new_credito_Click() vbCritical, "MUEBLERIA BUDDY"
Private Sub cmdsalidas_Click() Else
salidas.Show End Sub MsgBox Err.Description,
End Sub vbCritical, "MUEBLERIA BUDDY"
Private Sub nuevo_Click() End If
Private Sub Command1_Click() new_cliente.Show
Form1.Show End Sub
End Sub
Private Sub reg_entrantes_Click()
reg_entradas.Show
End Sub End Sub
Private Sub Form_Load()
Text1.Text = Date Private Sub Private Sub usu_modificar_Click()
reg_movimientos_Click() cuentas.usu.Visible = False
reg_mov.Show cuentas.txtpa.Visible = True
Adodc1.ConnectionString = End Sub cuentas.cmddescargar.Visible =
"Provider=Microsoft.Jet.OLEDB.4. True
0;" & _ Private Sub salir_Click() cuentas.cmdnuevo.Visible = False
"Data End cuentas.Show
Source=..\MUEBLERIA End Sub
BUDDY\sub_base_datos." & _ End Sub
"MDB;Persist Private Sub usu_nuevo_Click()
Security Info=False" Private Sub Timer1_Timer() cuentas.usu.Visible = True
With Adodc1 Text1.Text = Date cuentas.txtpa.Visible = False
.CommandType = cuentas.cmddescargar.Visible =
adCmdText False
.RecordSource = "Select Adodc1.ConnectionString = cuentas.Show
codigo, cliente, producto, cantidad, "Provider=Microsoft.Jet.OLEDB.4. End Sub
deuda, fecha_de_pago From 0;" & _
creditos" "Data
Source=..\MUEBLERIA
.Refresh BUDDY\sub_base_datos." & _ Private Sub Adodc1_Error( _
Set DataGrid1.DataSource = "MDB;Persist ByVal ErrorNumber As Long, _
Adodc1.Recordset Security Info=False" Description As String, _
DataGrid1.MarqueeStyle = With Adodc1 ByVal Scode As Long, _
dbgHighlightRowRaiseCell .CommandType = ByVal Source As String, _
adCmdText ByVal HelpFile As String, _
.Visible = False .RecordSource = "Select ByVal HelpContext As Long, _
End With codigo, cliente, producto, cantidad, fCancelDisplay As Boolean)
error_Handler: deuda, fecha_de_pago From MsgBox " DEscripción del Error
creditos" :" & Description
On Error GoTo error_Handler .Refresh End Sub
With Adodc1

MUEBLERIA BUDDY Página 5


INGENIERIA DEL SOFTWARE

Private Sub Private Sub Case adRsnFirstChange


Adodc2_MoveComplete(ByVal Adodc2_WillChangeRecord(ByVal Case adRsnMove
adReason As adReason As Case adRsnRequery
ADODB.EventReasonEnum, ADODB.EventReasonEnum, Case adRsnResynch
ByVal pError As ADODB.Error, ByVal cRecords As Long, Case adRsnUndoAddNew
adStatus As adStatus As Case adRsnUndoDelete
ADODB.EventStatusEnum, ByVal ADODB.EventStatusEnum, ByVal Case adRsnUndoUpdate
pRecordset As pRecordset As Case adRsnUpdate
ADODB.Recordset) ADODB.Recordset) End Select
Adodc1.Caption = " Registro
actual: " & Dim bCancel As Boolean If bCancel Then adStatus =
CStr(Adodc1.Recordset.AbsoluteP Select Case adReason adStatusCancel
osition) Case adRsnAddNew End Sub
End Sub Case adRsnClose
Case adRsnDelete

Pago de clientes

Ilustración 4

Dim tabla3, Table As Recordset Set tabla3 = End If


Public opcion As Integer based.OpenRecordset(sentencia) End If
Public vaar As String End Sub If Form2.ope = 0 Then
If Form2.opcion = 1 Then
Sub Recupera() Sub buscar() Call prestamos.buscar2
recepcion_pagos.Show Call SSQL Unload Me
With tabla3 End If
With tabla3 If tabla3.RecordCount <> 0 Then End If
recepcion_pagos.lblcodigo.Captio
n = !codigo If Form2.ope = 1 Then If Form2.ope = 0 Then
recepcion_pagos.lblcliente.Captio Call Recupera If Form2.opcion = 2 Then
n = !cliente End If Call prestamos.Buscar3
recepcion_pagos.lblproducto.Capti Else Unload Me
on = !producto x = MsgBox("ERROR EN LA End If
recepcion_pagos.lbldeuda.Caption BUSQUEDA", vbInformation, End If
= !deuda "MUEBLERIA BUDDY") vaar = txtcodigo.Text
recepcion_pagos.txtcantidad.Text End If End If
= !cantidad End With End Sub
recepcion_pagos.lblfecha.Caption End Sub
= !fecha_de_pago Private Sub Command2_Click()
recepcion_pagos.txtutilidad.Text = Private Sub Command1_Click() Unload Me
!utilidad End Sub
If txtcodigo.Text = "" Then
End With MsgBox (" NO VALIDO"), Private Sub Form_Load()
End Sub "MUEBLERIA BUDDY" Call leer
Else End Sub
Sub SSQL() If Form2.ope = 1 Then
sentencia = "Select * From If Form2.opcion = 0 Then
creditos Where codigo = '" & Call buscar
txtcodigo.Text & "'" Unload Me

MUEBLERIA BUDDY Página 6


INGENIERIA DEL SOFTWARE

Pantalla: nuevo producto

Ilustración 5

Dim progA As Recordset x = MsgBox("REGISTRO a = KeyAscii


Dim tabla4 As Recordset EXISTENTE", vbExclamation, If a = 46 Then
Dim opera As Integer "MUEBLERIA BUDDY") KeyAscii = 0
Public sw As Integer End If ElseIf a < 0 Or a > 57 Then
End If KeyAscii = 0
Private Sub Command1_Click() If opera = 2 Then End If
If txtnombre.Text = "" Or If prog_A.RecordCount <> 0 Then End Sub
txtcompra.Text = "" Or prog_A.Edit Sub Sentencia_SQL4()
txtventa.Text = "" Or Call EscribirEnBase sentencia = "Select * From
txtcantidad.Text = "" Then Else movimientos Where fecha = '" &
x = MsgBox("FALTAN DATOS x = MsgBox("REGISTRO txtfecha.Text & "'"
PARA FUNCIONAR", vbCritical, EXISTENTE", vbInformation, Set tabla4 =
"MUEBLERIA BUDDY") "MUEBLERIA BUDDY") based.OpenRecordset(sentencia)
Else End If End Sub
sw = 2 End If
Call Guardar End Sub
Unload Me
End If Sub Sentencia_SQL() Private Sub
End Sub sentencia = " SELECT * FROM txtcompra_KeyPress(KeyAscii As
ingresos WHERE nombre = '" & Integer)
Private Sub Command2_Click() txtnombre.Text & "'" & "" a = KeyAscii
Unload Me Set progA = If a = 46 Then
End Sub based.OpenRecordset(sentencia) KeyAscii = 0
End Sub ElseIf a < 0 Or a > 57 Then
Private Sub Form_Load() KeyAscii = 0
Sub EscribirEnBase() End If
Call leer With progA
opera = 1 !nombre = txtnombre.Text End Sub
!precio_de_compra =
Label4.Caption = Date txtcompra.Text Private Sub
End Sub !precio_de_venta = txtventa.Text txtventa_KeyPress(KeyAscii As
Sub Guardar() !utilidad = txtventa.Text - Integer)
Call Sentencia_SQL txtcompra.Text a = KeyAscii
If opera = 1 Then !cantidad = txtcantidad.Text If a = 46 Then
If progA.RecordCount = 0 Then !utilidad = txtventa.Text - KeyAscii = 0
progA.AddNew txtcompra.Text ElseIf a < 0 Or a > 57 Then
Call EscribirEnBase .Update KeyAscii = 0
x = MsgBox("AGREGADO CON End With End If
EXITO", vbInformation, End Sub
"MUEBLERIA BUDDY") End Sub
Else Private Sub
txtcantidad_KeyPress(KeyAscii As
Integer)

MUEBLERIA BUDDY Página 7


INGENIERIA DEL SOFTWARE

Pantalla: ingreso de
mercancia

Ilustración 6

Public tabla As Recordset Set tabla2 =


Public tabla2, tabla3 As Recordset Private Sub based.OpenRecordset(sentencia)
Public tabla4 As Recordset txtactual_KeyPress(KeyAscii As End Sub
Public sw As Integer Integer) Sub Sentencia_SQL3()
Public var1 As Single a = KeyAscii sentencia = "Select * From
Public var2 As Single If a < 0 Or a > 57 Then entradas Where producto = '" &
Dim opera As Integer KeyAscii = 0 txtpa.Text & "'"
End If Set tabla3 =
Private Sub cmddescargar_Click() End Sub based.OpenRecordset(sentencia)
If txtpa.Text = "" Or txtactual.Text End Sub
= "" Or txtagregar.Text = "" Then Private Sub
x = MsgBox("FALTAN DATOS txtagregar_KeyPress(KeyAscii As Sub Guardar()
PARA FUNCIONAR", vbCritical, Integer) Call Sentencia_SQL
"MUEBLERIA BUDDY") a = KeyAscii If sw = 1 Then
Else If a = 46 Then If tabla.RecordCount = 0 Then
sw = 2 KeyAscii = 0 tabla.AddNew
Call Guardar ElseIf a < 0 Or a > 57 Then Call Escribir
Call Guardar2 KeyAscii = 0 x = MsgBox("Operacion Exítosa",
Unload Me End If vbInformation, "MUEBLERIA
End If BUDDY")
End Sub End Sub Else
x = MsgBox("El registro ya existe",
Private Sub Command2_Click() Private Sub txtpa_Click() vbInformation, "MUEBLERIA
Unload Me Call DesplegarLista BUDDY")
End Sub End Sub End If
End If
Private Sub Form_Load() Sub Sentencia_SQL() If sw = 2 Then
Call leer sentencia = "Select * From If tabla.RecordCount <> 0 Then
sw = 1 ingresos WHERE nombre = '" & tabla.Edit
opera = 1 txtpa.Text & "'" Call Escribir
crearLista Set tabla = x = MsgBox("Operacion Exítosa",
Label6.Caption = Date based.OpenRecordset(sentencia) vbInformation, "MUEBLERIA
End Sub BUDDY")
End Sub Sub DesplegarLista() Else
Call Sentencia_SQL2 x = MsgBox("El registro no existe",
Sub crearLista() With tabla2 vbCritical, "MUEBLERIA BUDDY")
Set tabla2 = txtpa.Text = !nombre End If
based.OpenRecordset("ingresos") txtactual.Text = !cantidad End If
If tabla2.RecordCount <> 0 Then End With End Sub
tabla2.MoveFirst End Sub Sub Guardar2()
Do While Not tabla2.EOF Call Sentencia_SQL3
txtpa.AddItem tabla2!nombre Sub Sentencia_SQL2() tabla3.AddNew
tabla2.MoveNext sentencia = "Select * From Call Escribir2
Loop ingresos Where nombre = '" & End Sub
End If txtpa.Text & "'"
End Sub Sub Escribir()

MUEBLERIA BUDDY Página 8


INGENIERIA DEL SOFTWARE

With tabla Sub Escribir2() !producto = txtpa.Text


var1 = txtactual.Text With tabla3 !cantidad_anterior = txtactual.Text
var2 = txtagregar.Text Dim var1 As Long !cantidad_entrante =
!cantidad = var1 + var2 Dim var2 As Long txtagregar.Text
!nombre = txtpa.Text !cantidad_total = var1 + var2
.Update var1 = txtactual.Text
End With var2 = txtagregar.Text .Update
End Sub End With
!fecha = Label6.Caption End Sub

Pantalla: venta de
mercancias

Ilustración 7

Public tabla As Recordset crearLista2 a = KeyAscii


Public tabla2, tabla3 As Recordset Label8.Caption = Date If a < 0 Or a > 57 Then
Public tabla4 As Recordset KeyAscii = 0
Public tabla5 As Recordset End Sub End If
Public sw As Integer End Sub
Public var1 As Single Sub crearLista()
Public var2 As Single Set tabla2 =
Dim opera As Integer based.OpenRecordset("ingresos") Private Sub
If tabla2.RecordCount <> 0 Then txtagregar_KeyPress(KeyAscii As
Private Sub cmddescargar_Click() tabla2.MoveFirst Integer)
If txtretirar.Text = "" Or Do While Not tabla2.EOF a = KeyAscii
txtventa.Text = "" Then txtpa.AddItem tabla2!nombre If a = 46 Then
x = MsgBox("FALTAN DATOS tabla2.MoveNext KeyAscii = 0
PARA INICIAR", vbCritical, Loop ElseIf a < 0 Or a > 57 Then
"MUEBLERIA BUDDY") End If KeyAscii = 0
Else End Sub End If
sw = 2 Sub crearLista2()
Call Guardar Set tabla5 = End Sub
Call Guardarmov based.OpenRecordset("clientes")
Unload Me If tabla5.RecordCount <> 0 Then Private Sub txtpa_Click()
End If tabla5.MoveFirst Call DesplegarLista
End Sub Do While Not tabla5.EOF End Sub
txtclientes.AddItem tabla5!nombre Sub Sentencia_SQL()
Private Sub Command2_Click() tabla5.MoveNext sentencia = "Select * From
Unload Me Loop ingresos Where nombre = '" &
End Sub End If txtpa.Text & "'"
End Sub Set tabla =
Private Sub Form_Load() based.OpenRecordset(sentencia)
Call leer End Sub
sw = 1 Private Sub
opera = 1 txtactual_KeyPress(KeyAscii As Sub Sentencia_SQL2()
crearLista Integer)

MUEBLERIA BUDDY Página 9


INGENIERIA DEL SOFTWARE

sentencia = "Select * From txtclientes.Text = !no End Sub


ingresos Where nombre = '" & txtempresa.Text = !empresa Sub Guardarmov()
txtpa.Text & "'" Call Sentencia_SQL3
Set tabla2 = End With tabla5.AddNew
based.OpenRecordset(sentencia) End Sub Call Escribirmov
End Sub End Sub
Sub Sentencia_SQL3() Sub Guardar()
sentencia = "Select * From Call Sentencia_SQL Sub Escribir()
mov" If sw = 1 Then With tabla
Set tabla5 = If tabla.RecordCount = 0 Then var1 = txtactual.Text
based.OpenRecordset(sentencia) tabla.AddNew var2 = txtretirar.Text
End Sub Call Escribir !cantidad = var1 - var2
Sub Sentencia_SQL4() x = MsgBox("Nuevo registro !precio_de_venta = txtventa.Text
sentencia = "Select * From guardado", vbInformation, !nombre = txtpa.Text
clientes Where nombre = '" & "MUEBLERIA BUDDY")
txtclientes.Text & "'" Else .Update
Set tabla4 = x = MsgBox("El registro ya existe", End With
based.OpenRecordset(sentencia) vbInformation, "MUEBLERIA End Sub
End Sub BUDDY")
End If Sub Escribirmov()
Sub DesplegarLista() End If With tabla5
Call Sentencia_SQL2 If sw = 2 Then !fecha = Label8.Caption
With tabla2 If tabla.RecordCount <> 0 Then !articulo = txtpa.Text
txtpa.Text = !nombre tabla.Edit !cantidad = txtretirar.Text
txtactual.Text = !cantidad Call Escribir !VALOR = txtretirar.Text *
txtutilidad.Text = !utilidad x = MsgBox("SENTENCIA txtventa.Text
txtventa.Text = !precio_de_venta EJECUTADA", vbInformation, !vendido_a = txtclientes.Text
"MUEBLERIA BUDDY") !valor_unitario = txtventa.Text
End With Else !utilidad = txtutilidad.Text *
End Sub x = MsgBox("ERROR, NO txtretirar.Text
EXISTE", vbCritical, "MUEBLERIA
Sub Desplegar() BUDDY") .Update
Call Sentencia_SQL4 End If End With
With tabla4 End If End Sub

Pantalla: inventario

Ilustración 8

Option Explicit

MUEBLERIA BUDDY Página 10


INGENIERIA DEL SOFTWARE

Private Declare Function CStr(Adodc1.Recordset.AbsoluteP .CommandType =


SetErrorMode Lib "kernel32" osition) adCmdText
(ByVal wMode As Long) As Long End Sub .RecordSource = "Select *
Private Declare Sub From ingresos"
InitCommonControls Lib Private Sub .Refresh
"Comctl32" () Adodc2_WillChangeRecord(ByVal Set DataGrid1.DataSource =
adReason As Adodc1.Recordset
Private Sub cmdall_Click() ADODB.EventReasonEnum, DataGrid1.MarqueeStyle =
infoinventario.Show ByVal cRecords As Long, dbgHighlightRowRaiseCell
adStatus As
End Sub ADODB.EventStatusEnum, ByVal .Visible = False
pRecordset As End With
Private Sub Command1_Click() ADODB.Recordset)
Unload Me
End Sub Dim bCancel As Boolean
Select Case adReason End Sub
Private Sub Form_Initialize() Case adRsnAddNew
Call SetErrorMode(2) Case adRsnClose Private Sub Timer1_Timer()
Call InitCommonControls Case adRsnDelete Adodc1.ConnectionString =
End Sub Case adRsnFirstChange "Provider=Microsoft.Jet.OLEDB.4.
Case adRsnMove 0;" & _
Private Sub Adodc1_Error( _ Case adRsnRequery "Data
ByVal ErrorNumber As Long, _ Case adRsnResynch Source=..\MUEBLERIA
Description As String, _ Case adRsnUndoAddNew BUDDDY\sub_base_datos." & _
ByVal Scode As Long, _ Case adRsnUndoDelete "MDB;Persist
ByVal Source As String, _ Case adRsnUndoUpdate Security Info=False"
ByVal HelpFile As String, _ Case adRsnUpdate
ByVal HelpContext As Long, _ End Select With Adodc1
fCancelDisplay As Boolean) .CommandType =
If bCancel Then adStatus = adCmdText
MsgBox " DEscripción del Error :" adStatusCancel .RecordSource = "Select *
& Description, "MUEBLERIA End Sub From ingresos"
BUDDY" .Refresh
End Sub Set DataGrid1.DataSource =
Private Sub Form_Load() Adodc1.Recordset
Private Sub DataGrid1.MarqueeStyle =
Adodc2_MoveComplete(ByVal Adodc1.ConnectionString = dbgHighlightRowRaiseCell
adReason As "Provider=Microsoft.Jet.OLEDB.4.
ADODB.EventReasonEnum, 0;" & _ .Visible = False
ByVal pError As ADODB.Error, "Data End With
adStatus As Source=..\MUEBLERIA
ADODB.EventStatusEnum, ByVal BUDDY\sub_base_datos." & _
pRecordset As "MDB;Persist End Sub
ADODB.Recordset) Security Info=False"
Adodc1.Caption = " Registro
actual: " & With Adodc1

MUEBLERIA BUDDY Página 11


INGENIERIA DEL SOFTWARE

Modificar o eliminar

Ilustración 9

Public tabla As Recordset Private Sub Set tabla =


Public tabla2, tabla3 As Recordset txtactual_KeyPress(KeyAscii As based.OpenRecordset(sentencia)
Public tabla4 As Recordset Integer) End Sub
Public sw As Integer a = KeyAscii Sub DesplegarLista()
Dim opera As Integer If a < 0 Or a > 57 Then Call Sentencia_SQL2
KeyAscii = 0 With tabla2
Private Sub cmddescargar_Click() End If txtpa.Text = !nombre
sw = 2 End Sub txtnew.Text = !nombre
Call Guardar txtempresa.Text = !empresa
Unload Me txttelefono.Text = !telefono
End Sub Private Sub txtdireccion.Text = !Direccion
txtcantidad_KeyPress(KeyAscii As
Private Sub Command1_Click() Integer)
sw = 2 a = KeyAscii End With
Call Eliminar If a = 46 Then End Sub
Unload Me KeyAscii = 0
End Sub ElseIf a < 0 Or a > 57 Then Sub Sentencia_SQL2()
KeyAscii = 0 sentencia = "Select * From
Private Sub Command2_Click() End If clientes Where nombre = '" &
Unload Me txtpa.Text & "'"
End Sub End Sub Set tabla2 =
based.OpenRecordset(sentencia)
Private Sub Form_Load() Private Sub End Sub
Call leer txtcompra_KeyPress(KeyAscii As
sw = 1 Integer) Private Sub
opera = 1 a = KeyAscii txtutilidad_KeyPress(KeyAscii As
crearLista If a = 46 Then Integer)
KeyAscii = 0 a = KeyAscii
End Sub ElseIf a < 0 Or a > 57 Then If a = 46 Then
KeyAscii = 0 KeyAscii = 0
Sub crearLista() End If ElseIf a < 0 Or a > 57 Then
Set tabla2 = KeyAscii = 0
based.OpenRecordset("clientes") End Sub End If
If tabla2.RecordCount <> 0 Then
tabla2.MoveFirst Private Sub txtpa_Click() End Sub
Do While Not tabla2.EOF Call DesplegarLista
txtpa.AddItem tabla2!nombre End Sub Private Sub
tabla2.MoveNext txtventa_KeyPress(KeyAscii As
Loop Sub Sentencia_SQL() Integer)
End If sentencia = "Select * From a = KeyAscii
End Sub clientes WHERE nombre = '" & If a = 46 Then
txtpa.Text & "'" KeyAscii = 0
ElseIf a < 0 Or a > 57 Then

MUEBLERIA BUDDY Página 12


INGENIERIA DEL SOFTWARE

KeyAscii = 0 End If x = MsgBox("MODIFICADO CON


End If End If EXITO", vbInformation,
End If "MUEBLERIA BUDDY")
End Sub End Sub Else
x = MsgBox("ERROR", vbCritical)
Sub Eliminar() Sub Guardar() End If
Call Sentencia_SQL Call Sentencia_SQL End If
If tabla.RecordCount <> o Then If sw = 1 Then End Sub
x = MsgBox("¿ELIMENAR If tabla.RecordCount = 0 Then
REGISTRO?", vbYesNo, tabla.AddNew Sub Escribir()
"MUEBLERIA BUDDY") Call Escribir With tabla
If x = vbYes Then x = MsgBox("GUARDADO", !nombre = txtpa.Text
tabla.Delete vbInformation) !nombre = txtnew.Text
If tabla.BOF Then Else !empresa = txtempresa.Text
tabla.MoveNext x = MsgBox("ERROR: EL !telefono = txttelefono.Text
Else REGISTRO YA EXISTE", !Direccion = txtdireccion.Text
If tabla.EOF Then vbInformation, "MUEBLERIA .Update
tabla.MovePrevious BUDDY") End With
Else End If End Sub
tabla.MoveNext End If
End If If sw = 2 Then
x = MsgBox("REGISTRO If tabla.RecordCount <> 0 Then
ELIMINADO", vbInformation, tabla.Edit
"MUEBLERIA BUDDY") Call Escribir

Pantalla: ventas a credito

Ilustración 10

Private Declare Function


Public tabla As Recordset Dim sentencia As Variant SetErrorMode Lib "kernel32"
Public tabla2, tabla3 As Recordset Dim x As Variant (ByVal wMode As Long) As Long
Public tabla4 As Recordset Private Declare Sub
Public sw As Integer Option Explicit InitCommonControls Lib
Public var1 As Single "Comctl32" ()
Public var2 As Single
Dim opera As Integer

MUEBLERIA BUDDY Página 13


INGENIERIA DEL SOFTWARE

Private Sub Command1_Click() Case adRsnUpdate


mod_credito.Show End Select Else
Unload Me .Recordset.Filter = ""
End Sub If bCancel Then adStatus = End If
adStatusCancel .Refresh
Private Sub Command2_Click() End Sub End With
registro_movimientos.Show Exit Sub
End Sub error_Handler:
Private Sub Form_Load() If Err.Number = 3265 Then
Call leer MsgBox "ERROR", vbCritical,
Private Sub Command12_Click() sw = 1 "MUEBLERIA BUDDY"
cartera.Show opera = 1 Else
End Sub crearLista MsgBox "Err.Description",
crearLista2 vbCritical, "MUEBLERIA BUDDY"
Private Sub Form_Initialize() Label8.Caption = Date End If
Call SetErrorMode(2) Adodc1.ConnectionString = End Sub
Call InitCommonControls "Provider=Microsoft.Jet.OLEDB.4.
End Sub 0;" & _
"Data Private Sub cmddescargar_Click()
Private Sub Adodc1_Error( _ Source=..\MUEBLERIA If txtpa.Text = "" Or txtclientes.Text
ByVal ErrorNumber As Long, _ BUDDY\sub_base_datos." & _ = "" Or txtventa.Text = "" Or
Description As String, _ "MDB;Persist txtutilidad.Text = "" Or
ByVal Scode As Long, _ Security Info=False" txtactual.Text = "" Or txtretirar.Text
ByVal Source As String, _ With Adodc1 = "" Or txtcodigo.Text = "" Then
ByVal HelpFile As String, _ .CommandType = x = MsgBox("FALTAN DATOS
ByVal HelpContext As Long, _ adCmdText PARA FUNCIONAR", vbCritical,
fCancelDisplay As Boolean) "MUEBLERIA BUDDY")
.RecordSource = "Select * Else
MsgBox " DEscripción del Error :" From creditos" sw = 1
& Description, "MUEBLERIA Call Guardar
BUDDY" .Refresh Call Guardar2
End Sub
Set DataGrid1.DataSource = Unload Me
Private Sub Adodc1.Recordset End If
Adodc2_MoveComplete(ByVal End Sub
adReason As DataGrid1.MarqueeStyle =
ADODB.EventReasonEnum, dbgHighlightRowRaiseCell Private Sub Command10_Click()
ByVal pError As ADODB.Error, Unload Me
adStatus As .Visible = False End Sub
ADODB.EventStatusEnum, ByVal End With
pRecordset As Sub crearLista()
ADODB.Recordset) With Combo1 Set tabla2 =
Adodc1.Caption = " Registro based.OpenRecordset("ingresos")
actual: " & If tabla2.RecordCount <> 0 Then
CStr(Adodc1.Recordset.AbsoluteP End With tabla2.MoveFirst
osition) Text1 = "" Do While Not tabla2.EOF
End Sub txtpa.AddItem tabla2!nombre
With Adodc1.Recordset tabla2.MoveNext
Private Sub Dim total As Long Loop
Adodc2_WillChangeRecord(ByVal Do While Not .EOF End If
adReason As End Sub
ADODB.EventReasonEnum,
ByVal cRecords As Long, total = total + !deuda
adStatus As Sub crearLista2()
ADODB.EventStatusEnum, ByVal .MoveNext Set tabla =
pRecordset As Label13.Caption = total based.OpenRecordset("clientes")
ADODB.Recordset) If tabla.RecordCount <> 0 Then
Loop tabla.MoveFirst
Dim bCancel As Boolean Do While Not tabla.EOF
Select Case adReason End With txtclientes.AddItem tabla!nombre
Case adRsnAddNew End Sub tabla.MoveNext
Case adRsnClose Loop
Case adRsnDelete Private Sub Text1_Change() End If
Case adRsnFirstChange On Error GoTo error_Handler End Sub
Case adRsnMove With Adodc1
Case adRsnRequery If Text1 <> "" Then Private Sub txtpa_Click()
Case adRsnResynch .Recordset.Filter = Call DesplegarLista
Case adRsnUndoAddNew Combo1 & " LIKE '*" + Text1 + "*'" End Sub
Case adRsnUndoDelete Set DataGrid1.DataSource
Case adRsnUndoUpdate = Adodc1.Recordset Sub Sentencia_SQL()

MUEBLERIA BUDDY Página 14


INGENIERIA DEL SOFTWARE

sentencia = "Select * From Set tabla3 = !codigo = txtcodigo.Text


clientes WHERE nombre = '" & based.OpenRecordset(sentencia) !cliente = txtclientes.Text
txtpa.Text & "'" End Sub !producto = txtpa.Text
Set tabla = !cantidad = txtretirar.Text
based.OpenRecordset(sentencia) Sub Guardar() !deuda = txtretirar.Text *
End Sub Call Sentencia_SQL3 txtventa.Text
Sub DesplegarLista() tabla3.AddNew !fecha_de_pago =
Call Sentencia_SQL2 Call Escribir DTPicker1.Value
With tabla2 End Sub !utilidad = txtutilidad.Text
txtventa.Text = !precio_de_venta Sub Guardar2()
txtutilidad.Text = !utilidad Call Sentencia_SQL2 .Update
txtactual.Text = !cantidad If tabla2.RecordCount <> 0 Then End With
End With tabla2.Edit End Sub
End Sub Call Escribir2
x = MsgBox("EXCELENTE", Sub Escribir2()
Sub Sentencia_SQL2() vbInformation, "MUEBLERIA With tabla2
sentencia = "Select * From BUDDY") var1 = txtactual.Text
ingresos Where nombre = '" & Else var2 = txtretirar.Text
txtpa.Text & "'" x = MsgBox("NO EXISTE", !cantidad = var1 - var2
Set tabla2 = vbCritical, "MUEBLERIA BUDDY") !precio_de_venta = txtventa.Text
based.OpenRecordset(sentencia) End If !nombre = txtpa.Text
End Sub
End Sub .Update
Sub Sentencia_SQL3() End With
sentencia = "Select * From Sub Escribir() End Sub
creditos " With tabla3

Pantalla: movimientos
Private Declare Function
SetErrorMode Lib "kernel32"
(ByVal wMode As Long) As
Long
Private Declare Sub
InitCommonControls Lib
"Comctl32" ()
Private Sub
Command10_Click()
Unload Me
End Sub

Private Sub Command2_Click()


registro_movimientos.Show
End Sub

Private Sub Form_Initialize()


Call SetErrorMode(2)
Call InitCommonControls
End Sub

Private Sub Adodc1_Error( _


ByVal ErrorNumber As Long,
_
Ilustración 11 Description As String, _
ByVal Scode As Long, _
ByVal Source As String, _
ByVal HelpFile As String, _
ByVal HelpContext As Long,
_
fCancelDisplay As Boolean)

MsgBox " DESCRIPCION DEL


ERROR" & Description,
"MUEBLERIA BUDDY"
End Sub

MUEBLERIA BUDDY Página 15


INGENIERIA DEL SOFTWARE

Private Sub Adodc1.ConnectionString =


Adodc2_MoveComplete(ByVal "Provider=Microsoft.Jet.OLEDB.
adReason As 4.0;" & _ End With
ADODB.EventReasonEnum, "Data End Sub
ByVal pError As ADODB.Error, Source=..\MUEBLERIA
adStatus As BUDDY\sub_base_datos." & _ Private Sub Text1_Change()
ADODB.EventStatusEnum, "MDB;Persist On Error GoTo error_Handler
ByVal pRecordset As Security Info=False" With Adodc1
ADODB.Recordset) If Text1 <> "" Then
Adodc1.Caption = " Registro With Adodc1 .Recordset.Filter =
actual: " & .CommandType = Combo1 & " LIKE '*" + Text1 +
CStr(Adodc1.Recordset.Absolut adCmdText "*'"
ePosition) .RecordSource = "Select * Set
End Sub From mov" DataGrid1.DataSource =
Adodc1.Recordset
Private Sub .Refresh With Adodc1.Recordset
Adodc2_WillChangeRecord(ByV Dim total As Long
al adReason As Set DataGrid1.DataSource
ADODB.EventReasonEnum, = Adodc1.Recordset
ByVal cRecords As Long, DataGrid1.MarqueeStyle = Do While Not .EOF
adStatus As dbgHighlightRowRaiseCell total = total + !VALOR
ADODB.EventStatusEnum, .MoveNext
ByVal pRecordset As .Visible = False Label5.Caption = total
ADODB.Recordset) End With Loop

Dim bCancel As Boolean With Combo1 End With


Select Case adReason
Case adRsnAddNew End With Else
Case adRsnClose Text1 = "" .Recordset.Filter = ""
Case adRsnDelete End If
Case adRsnFirstChange .Refresh
Case adRsnMove With Adodc1.Recordset End With
Case adRsnRequery Dim total As Long Exit Sub
Case adRsnResynch Dim total2 As Long error_Handler:
Case adRsnUndoAddNew Dim total3 As Long If Err.Number = 3265 Then
Case adRsnUndoDelete MsgBox "DATOS NO
Case adRsnUndoUpdate VALIDOS", vbCritical,
Case adRsnUpdate Do While Not .EOF "MUEBLERIA BUDDY"
End Select total = total + !VALOR Else
total2 = total2 + !utilidad MsgBox Err.Description,
If bCancel Then adStatus = total3 = total3 + !cantidad vbCritical, "MUEBLERIA
adStatusCancel .MoveNext BUDDY"
End Sub Label2.Caption = total End If
Label6.Caption = total2 End Sub
Label8.Caption = total3
Private Sub Form_Load() Loop

ACCESO con permisos restringidos

En esta pantalla el usuario tendra acceso solo a ver los


registros de entrada, siempre y cuando no se
modifiquen los permisos de usuario.
Esto solo es el modelo de cómo podria ser el acceso a
usuarios con permisos restringidos.

Ilustración 12

MUEBLERIA BUDDY Página 16


INGENIERIA DEL SOFTWARE

Otro ejemplo de pantalla son los demas tipos de usuarios que en seguida se
muestran
USUARIO RESTRINGIDO
USUARIO RESTRINGIDO X USUARIO RESTRINGIDO Y

MUEBLERIA BUDDY Página 17

You might also like