Sistema de Ventas de Autos con Base de Datos (Visual Basic)
![visual basic.png](https://images.hive.blog/768x0/https://steemitimages.com/DQmdN8d67Ybcn5HF8TC6TbL9tLbSCo2ZgAavbvAbbS5CPMU/visual%20basic.png)
CONSIGNA
Realizar un Sistema de Ventas de Autos con Base de Datos e informar: precio, descripción, modelo del auto y la comisión por venta.
INTERFAZ
![Formulario.jpg](https://images.hive.blog/768x0/https://steemitimages.com/DQmQxfgnRP5PtY9ELfeyH9hBERbdsNsLKdhDeXE55WHchYg/Formulario.jpg)
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
Bases de Datos: marcas
![marcas.jpg](https://images.hive.blog/768x0/https://steemitimages.com/DQmWm1A698EeQr8VqBfwDEggaCMNMnBw3Fy5ce3bfaRWXDT/marcas.jpg)
Bases de Datos: vendedor
![vendedor.jpg](https://images.hive.blog/768x0/https://steemitimages.com/DQmNx1ErH8Ab9RBBAq7KzsjgDxhE63NMHtE46ZBJG8UeiUE/vendedor.jpg)
Bases de Datos: ventas
![ventas.jpg](https://images.hive.blog/768x0/https://steemitimages.com/DQmd7ZyEq62qjTSGL9vrycZX29BPvWcphsD5CPjUiLrpwHx/ventas.jpg)
FUENTE
Private Sub ejecutar_Click()
Text3 = Val(Text2) * Val(Text4) / 100
Text5 = Val(Text2) + Val(Text3)
If Val(Text12) = 2014 Or 2015 Then
Text8 = Val(Text2) * 20 / 100
Else
Text8 = Val(Text2) * 25 / 100
End If
Text9 = Val(Text7) + Val(Text8)
Text10 = Val(Text9) + Val(Text5)
End Sub
Private Sub limpiar_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
End Sub
Private Sub marcas_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\18-10\AUTOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM marcas WHERE pat like " & "'" & Trim(Text1) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
Text1 = MYTABLE("pat")
Text11 = MYTABLE("descripcion")
Text12 = MYTABLE("modelo")
MYTABLE.MoveNext
Loop
End Sub
Private Sub salir_Click()
Unload Me
End Sub
Private Sub vendedor_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\18-10\AUTOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM vendedor WHERE dni like " & "'" & Trim(Text6) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
Text6 = MYTABLE("dni")
Text7 = MYTABLE("sueldobas")
MYTABLE.MoveNext
Loop
End Sub
Private Sub ventas_Click()
Set MYDB = DBEngine.Workspaces(0).OpenDatabase("E:\Programacion II\18-10\AUTOS.MDB")
Set MYTABLE = MYDB.OpenRecordset("SELECT * FROM ventas WHERE pat like " & "'" & Trim(Text1) & "';", dbOpenSnapshot)
Do While Not MYTABLE.EOF()
Text1 = MYTABLE("pat")
Text2 = MYTABLE("precio")
MYTABLE.MoveNext
Loop
End Sub
![steemit-mauri.gif](https://images.hive.blog/0x0/https://steemitimages.com/DQmUPekDQE7mmDoCAEKBcK1YNTZEkiWFvY9676aJDVeywhv/steemit-mauri.gif)