Programar

Páginas: 7 (1627 palabras) Publicado: 27 de agosto de 2012
LOGIN

Private Sub Command1_Click()
Dim a As Recordset
Set a = x.OpenRecordset("CONTRASEÑA", dbOpenDynaset)
a.FindFirst "CONTRASEÑA= '" & Text2 & "' And USUARIO= '" & Text1 & "'"
If Not a.NoMatch Then
MsgBox "BIENVENIDO AL SISTEMA DE COMPRA Y VENTA", vbInformation, "BIENVENIDO"
Unload Me
MENU.Show
Else
MsgBox "USUARIO O CONTRASEÑA INCORRECTAS", vbCritical, "INCORRECTO"
Text1.SetFocusText1 = ""
Text2 = ""
End If
End Sub


Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub


MENU

Private SubCLIENTES_Click()
INGRESODECLIENTES.Show
End Sub

Private Sub CLIENTES1_Click()
CONSULTACLIENTES.Show
End Sub

Private Sub CLIENTES2_Click()
MODIFICACIONCLIENTES.Show
End Sub

Private Sub CLIENTES3_Click()
ELIMINACIONCLIENTES.Show
End Sub

Private Sub PRODUCTOS_Click()
INGRESODEPRODUCTOS.Show
End Sub

Private Sub PRODUCTOS1_Click()
CONSULTAPRODUCTOS.Show
End Sub

Private SubPRODUCTOS2_Click()
MODIFICACIONPRODUCTOS.Show
End Sub

Private Sub PRODUCTOS3_Click()
ELIMINACIONPRODUCTOS.Show
End Sub

Private Sub PROVEEDORES_Click()
INGRESODEPROVEEDORES.Show
End Sub

Private Sub SI_Click()
End
End Sub

Private Sub PROVEEDORES1_Click()
CONSULTAPROVEEDORES.Show

End Sub

Private Sub PROVEEDORES2_Click()
MODIFICACIONPROVEEDORES.Show
End Sub

Private SubPROVEEDORES3_Click()
ELIMINACIONPROVEEDORES.Show
End Sub

Private Sub SALIR_Click()
a = MsgBox("DESEA SALIR", vbYesNo, "SALIR")
If a = vbYes Then
Unload Me
End If
End Sub








INGRESO DE CLIENTES

Private Sub Command1_Click()
If Text1.Text = "" Then MsgBox " Campo Codigo No Puede estar en blanco ", vbInformation: Text1.SetFocus: Exit Sub
If Text2.Text = "" Then MsgBox "Campo Nombre No Puede estar en blanco ", vbInformation: Text2.SetFocus: Exit Sub
If Text3.Text = "" Then MsgBox " Campo Instituciones No Puede estar en blanco ", vbInformation: Text3.SetFocus: Exit Sub
If Text4.Text = "" Then MsgBox " Campo RUC No Puede estar en blanco ", vbInformation: Text4.SetFocus: Exit Sub
If Text5.Text = "" Then MsgBox " Campo Direccion No Puede estar en blanco ",vbInformation: Text5.SetFocus: Exit Sub
If Text6.Text = "" Then MsgBox " Campo Telefono No Puede estar en blanco ", vbInformation: Text6.SetFocus: Exit Sub
If Text7.Text = "" Then MsgBox " Campo Email No Puede estar en blanco ", vbInformation: Text7.SetFocus: Exit Sub
Dim c As Recordset
Set c = x.OpenRecordset("INGCLIENTES", dbOpenDynaset)
c.FindFirst " [NOMBRE] = ' " & NOMBRE & " ' "
If c.NoMatchThen
c.AddNew
c!CODIGO = Text1
c!FECHA = Date
c!NOMBRE = Text2
c!RUC = Text3
c!INSTITUCION = Text4
c!TELEFONO = Text5
c!DIRECCION = Text6
c!EMAIL = Text7
c.Update
LIMPIAR
MsgBox " REGISTRO AGREGADO", vbInformation
Else

MsgBox " EL CLIENTE YA EXISTE", vbInformation
End If
FECHA = Date
End Sub

Private Sub Command2_Click()
LIMPIAR
End Sub

Private Sub Command3_Click()Unload Me
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii= 13 Then
Text5.SetFocus
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text6.SetFocus
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub

Sub LIMPIAR()
Text1 = ""...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Programa
  • Program
  • Un Programa
  • Programas
  • Programas
  • Programa
  • Programador
  • Program

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS