Anda di halaman 1dari 4

Imports System.Data.OleDb Public Class Form1 Dim dt As New DataTable Dim registro As Integer = 0 Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Alumnos\Desktop\Control_Escolar021.

accdb") Private Sub Button1_Click(ByVal sender As System.Object, ByVal System.EventArgs) Handles Button1.Click Select Case TextBox2.Text() Case 1 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de enero de " + TextBox3.Text()) Case 2 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de febrero de " + TextBox3.Text()) Case 3 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de marzo de " + TextBox3.Text()) Case 4 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de abril de " + TextBox3.Text()) Case 5 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de mayo de " + TextBox3.Text()) Case 6 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de junio de " + TextBox3.Text()) Case 7 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de julio de " + TextBox3.Text()) Case 8 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de agosto de " + TextBox3.Text()) Case 9 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de septiembre de " + TextBox3.Text()) Case 10 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de octubre de " + TextBox3.Text()) Case 11 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de noviembre de " + TextBox3.Text()) Case 12 MsgBox("El maestro " + dt.Rows(registro)("Nombre") " + TextBox1.Text() + " de diciembre de " + TextBox3.Text()) End Select End Sub Public Sub actualiza() Dim d As Date d = CDate(dt.Rows(registro)("Fechanac")) TextBox1.Text() = d.Day Dim m As Date m = CDate(dt.Rows(registro)("Fechanac")) TextBox2.Text() = m.Month Dim y As Date y = CDate(dt.Rows(registro)("Fechanac")) e As

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

+ " nacio el dia

TextBox3.Text() = y.Year

End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cn.Open() Dim consulta As String = "select * from Maestros" Dim dataAdapter As New OleDbDataAdapter(consulta, cn) dataAdapter.Fill(dt) actualiza() dataAdapter.Dispose() cn.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If (registro > 0 And registro <= dt.Rows.Count - 1) Then registro = registro - 1 actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If

End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click If (registro >= 0 And registro < dt.Rows.Count - 1) Then registro = registro + 1 actualiza() Else MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub End Class

Anda mungkin juga menyukai