Sistema de Recorrido de Colectivo con Base de Datos (Visual Basic)
Sistema de Recorrido de Colectivo con Base de Datos (Visual Basic)

CONSIGNA
Realizar un Sistema de Recorrido de Colectivo con Base de Datos e informar los kilómetros recorridos, el chófer, y el importe del recorrido.
INTERFAZ

Realizar las Bases de Datos, para ello ir a:
Complementos > Administrador de bases de datos...
Luego ir a Archivo > Nuevo... > Microsoft Access > MDB de la Version 7.0
Base de Datos chóferes

Base de Datos unidades

Base de Datos viajes

FUENTE
Private Sub choferes_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\11-10\COLECTIVOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM choferes WHERE dni like " & "'" & Trim(Text1) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
dni = MYTABLE("dni")
mya = MYTABLE("nya")
MYTABLE.MoveNext
Loop
End Sub
Private Sub Codigo_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\11-10\COLECTIVOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM viajes WHERE codigo like " & "'" & Trim(Text1) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
Codigo = MYTABLE("codigo")
destino = MYTABLE("destino")
MYTABLE.MoveNext
Loop
End Sub
Private Sub ejecutal_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\11-10\COLECTIVOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM unidades WHERE pat like " & "'" & Trim(Text1) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
pat = MYTABLE("pat")
kms = MYTABLE("kms")
MYTABLE.MoveNext
Loop
Text1 = pat
Text2 = Codigo
Text3 = 0
Text4 = Text3 + kms
Text5 = Text3 * 80
Text7 = 0
Text6 = Text5 * (100 / Text7)
Text8 = Text5 + Text6
Text9 = dni
Text10 = Text3 * 20
Text11 = Text10 * 0.18
Text12 = Text10 * 0.15
Text13 = Text10 - (Text11 - Text12)
Text14 = Text5 - Text10
End Sub
Private Sub limpiar_Click()
Text1 = 0
Text2 = 0
Text3 = 0
Text4 = 0
Text5 = 0
Text7 = 0
Text6 = 0
Text8 = 0
Text9 = 0
Text10 = 0
Text11 = 0
Text12 = 0
Text13 = 0
Text14 = 0
End Sub
Private Sub salir_Click()
Unload Me
End Sub
