Proyecto Visual Basic
Enviado por Antonio • 14 de Enero de 2019 • 877 Palabras (4 Páginas) • 520 Visitas
...
Text2.SetFocus
Exit Sub
End If
If PELIAJCM.Recordset.RecordCount = 0 Then
PELIAJCM.Recordset.MoveFirst
End If
PELIAJCM.Recordset.Find "CLAVE='" & Text1.Text & "'"
With PELIAJCM.Recordset
If .BOF = True And .EOF = True Then
MsgBox "Clave repetida", vbInformation, "Informacion"
Text1.SetFocus
Exit Sub
End If
!NOMBRE = Text2.Text
!ANIO = Text3.Text
!GENERO = Text4.Text
!IDIOMA = Text5.Text
!PRECIO = Text6.Text
.Update
MsgBox "Datos Modificados", vbInformation, "Informacion"
Text1.Enabled = True
End With
Text1.Enabled = True
Errores:
If Err 0 Then
MsgBox "Error Fatal", vbCritical, "Error"
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form4.Show
End Sub
Private Sub Command3_Click()
If (MsgBox("¿Esta seguro de salir?", vbQuestion + vbYesNo, "Pregunta") = vbYes) Then
End
End If
End Sub
Private Sub Command4_Click()
Unload Me
Form5.Show
End Sub
Private Sub Command5_Click()
On Error GoTo Errores
If Text1.Text = "" Then
MsgBox "datos vacios", vbInformation, "Informacion"
Text1.SetFocus
Exit Sub
End If
If PELIAJCM.Recordset.RecordCount 0 Then
PELIAJCM.Recordset.MoveFirst
End If
PELIAJCM.Recordset.Find "CLAVE='" & Text1.Text & "'"
With PELIAJCM.Recordset
If .BOF = True And .EOF = False Then
MsgBox "Clave repetida", vbInformation, "Informacion"
Text1.SetFocus
Exit Sub
End If
Text1.Text = !CLAVE
Text2.Text = !NOMBRE
Text3.Text = !ANIO
Text4.Text = !GENERO
Text5.Text = !IDIOMA
Text6.Text = !PRECIO
End With
Text1.SetFocus
Errores:
If Err 0 Then
MsgBox "Error Fatal", vbCritical, "Error"
End If
End Sub
Private Sub Command6_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command7_Click()
If (MsgBox("¿Esta seguro de cerrar sesion?", vbQuestion + vbYesNo, "Pregunta") = vbYes) Then
Unload Me
Form2.Show
End If
End Sub
Private Sub Command8_Click()
Unload Me
Form3.Show
End Sub
Private Sub Form_Load()
Dim PELI As String
On Error GoTo Errores
PELI = App.Path & "\PELISINFO505AJCM.mdb"
PELIAJCM.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & PELI
PELIAJCM.RecordSource = "TBL_DATOS"
PELIAJCM.Refresh
Errores:
If Err.Number 0 Then
MsgBox "Error de conexion", vbCritical, "Error BD"
End If
...