Database Diagram
The application uses MS Access as its backend database. The database contains the following three tables.
Car List
Primary Key
Field Name
Maker
Make
Year Model
Price Per Day
Currency
Plate Number
Primary Key
Field Name
Contact Number
Car Category
Plate Number
Price Per Day
Currency
Number of Days Rented
Continuation of Customer List Table
Primary Key
Field Name
Currency
Final Charge
Currency
Users List
Primary Key
Field Name
Username
Password
Forms
The application has 5 operations from the main form. This includes Login, Car Data Input, Customer Data Input, Car Charge Calculation, and Quit. Following are the design of each of these forms.
Login Form
Main Form
Car Data Input Form
Customer Data Input Form
Car Charge Calculator
Printout of Code
frmMain
Option Explicit
Private Sub-cmdCarInput_Click ()
frmCarInput.Show
End Sub
Private Sub-cmdChrgCalc_Click ()
frmChrgCalc.Show
End Sub
Private Sub-cmdCustInput_Click ()
frmCustInput.Show
End Sub
Private Sub-cmdOpenLogin_Click ()
frmLogin.Show
End Sub
Private Sub-cmdQuit_Click ()
End
End Sub
frmLogin
Option Explicit
Dim adoCon_MDB As New ADODB.Connection
Dim adoRS_MDB As New ADODB.Recordset
Private Sub-cmdLogin_Click ()
Dim recFound As Boolean
adoRS_MDB.Source = "SELECT * FROM [Users List]"
adoRS_MDB.Source = adoRS_MDB.Source & " WHERE Username = '" & txtUserNm & ""
adoRS_MDB.CursorType = adOpenDynamic
adoRS_MDB.ActiveConnection = adoCon_MDB
adoRS_MDB.Open
recFound = False
If adoRS_MDB.EOF Then
MsgBox "Username not found!," vbOKOnly, "Not Found"
txtUserNm.Text = "
txtPasswrd.Text = "
Else
If adoRS_MDB.Fields ("Password").Value Trim (txtPasswrd.Text) Then
MsgBox "Invalid Password.," vbOKOnly, "Invalid Password"
txtPasswrd.Text = "
txtPasswrd.SetFocus
Else
recFound = True
End If
End If
adoRS_MDB.Close
If recFound Then
frmMain.cmdCustInput.Enabled = True
frmMain.cmdCarInput.Enabled = True
frmMain.cmdChrgCalc.Enabled = True
frmLogin.Hide
adoCon_MDB.Close
End If
End Sub
Private Sub-Form_Load ()
adoCon_MDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:25690VB.mdb" adoCon_MDB.Open
End Sub
frmCarInput
Option Explicit
Dim adoCon As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
Private Sub-Init ()
txtPlate.Text = "
cboCategory.Text = "
txtMaker.Text = "
txtMake.Text = "
txtYrModel.Text = "
txtPricePerDay.Text = "
End Sub
Private Sub-Toggle ()
cmdAdd.Enabled = False
cmdEdit.Enabled = False
txtPlate.Enabled = True
cboCategory.Enabled = True
txtMaker.Enabled = True
txtMake.Enabled = True
txtYrModel.Enabled = True
txtPricePerDay.Enabled = True
End Sub
Private Sub-cboPlate_Click ()
adoCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:25690VB.mdb" adoCon.Open
adoRS.Source = "SELECT * FROM [Car List] WHERE [Plate Number] = '" & Trim (cboPlate.Text) & ""
adoRS.CursorType = adOpenDynamic
adoRS.ActiveConnection = adoCon
adoRS.Open
cboCategory.Text = adoRS.Fields ("Category")
txtMaker.Text = adoRS.Fields ("Maker")
txtMake.Text = adoRS.Fields ("Make")
txtYrModel.Text = adoRS.Fields ("Year Model")
txtPricePerDay.Text = adoRS.Fields ("Price Per Day")
adoRS.Close
adoCon.Close
End Sub
Private Sub-cmdAdd_Click ()
Toggle
cmdSave.Visible = True
cmdCancel.Visible = True
End Sub
Private Sub-cmdCancel_Click ()
cmdAdd.Enabled = True
cmdEdit.Enabled = True
Init
cboPlate.Visible = False
cboPlate.Enabled = False
txtPlate.Visible = True
txtPlate.Enabled = False
cboCategory.Enabled = False
txtMaker.Enabled = False
txtMake.Enabled = False
txtYrModel.Enabled = False
txtPricePerDay.Enabled = False
cmdSave.Visible = False
cmdCancel.Visible = False
cmdUpdate.Visible = False
End Sub
Private Sub-cmdEdit_Click ()
Dim x As Integer
Toggle
txtPlate.Enabled = False
txtPlate.Visible = False
cboPlate.Enabled = True
cboPlate.Visible = True
cmdUpdate.Visible = True
cmdCancel.Visible = True
adoCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:25690VB.mdb" adoCon.Open
adoRS.Source = "SELECT * FROM [Car List]"
adoRS.CursorType = adOpenDynamic
adoRS.ActiveConnection = adoCon
adoRS.Open
adoRS.MoveFirst
Do While Not adoRS.EOF
With cboPlate
.AddItem adoRS.Fields ("Plate Number")
adoRS.MoveNext
End With
Loop
adoRS.Close
adoCon.Close
End Sub
Private Sub-cmdSave_Click ()
Dim strSQL As String
Dim adoCmd As New ADODB.Command
Dim adoCon_MDB As New ADODB.Connection
Dim allFilled As Boolean
allFilled = False
If Trim (txtPlate.Text) = " Then
txtPlate.SetFocus
ElseIf Trim (cboCategory.Text) = " Then
cboCategory.SetFocus
ElseIf Trim (txtMaker.Text) = " Then
txtMaker.SetFocus
ElseIf Trim (txtMake.Text) = " Then
txtMake.SetFocus
ElseIf Trim (txtYrModel.Text) = " Then
txtYrModel.SetFocus
ElseIf txtPricePerDay.Text = 0 Then
txtPricePerDay.SetFocus
Else
allFilled = True
End If
If Not allFilled Then
MsgBox "All fields require input.," vbOKOnly, "Message"
Exit Sub
End If
adoCon_MDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:25690VB.mdb" adoCon_MDB.Open
strSQL = "INSERT INTO [Car List] ([Category], [Maker], [Make], [Year Model],"
strSQL = strSQL & " [Price Per Day], [Plate Number]) VALUES "
strSQL = strSQL & "('" & cboCategory.Text & ," '" & txtMaker.Text & ," '"
strSQL = strSQL & txtMake.Text & ," '" & txtYrModel.Text & ," '"
strSQL = strSQL & Format (txtPricePerDay.Text, "#######.00") & ," '" & txtPlate & ")"
adoCmd.CommandText = strSQL
adoCmd.CommandType = adCmdText
adoCmd.ActiveConnection = adoCon_MDB
adoCmd.Execute
Set adoCmd = Nothing
MsgBox "The record has been successfully added.," vbOKOnly, "Success"
adoCon_MDB.Close
Init
txtPlate.SetFocus
End Sub
Private Sub-cmdUpdate_Click ()
Dim strSQL As String
Dim adoCmd As New ADODB.Command
strSQL = "UPDATE [Car List] SET Category = '" & cboCategory.Text & ," "
strSQL = strSQL & "Maker = '" & txtMaker.Text & ," Make = '" & txtMake.Text & ," "
strSQL = strSQL & "[Year Model] = '" & txtYrModel.Text & ," [Price Per Day] = '" & txtPricePerDay.Text
strSQL = strSQL & " WHERE [Plate Number] = '" & cboPlate.Text & ""
adoCmd.CommandText = strSQL
adoCmd.CommandType = adCmdText
adoCmd.ActiveConnection = adoCon
adoCmd.Execute
Set adoCmd = Nothing
MsgBox "The record has been successfully updated.," vbOKOnly, "Success"
cboPlate.SetFocus
End Sub
frmCustInput
Option Explicit
Dim adoCon As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
Dim adoCon2 As New ADODB.Connection
Dim adoRS2 As New ADODB.Recordset
Dim...
Visual Basic Programming and Interface The Interface of Average Score Solution Code Public Class Form Private Sub-Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' calcualtes and displays the average solution ' declare variables Dim intAllen As Integer Dim intPeter As Integer Dim intSmith As Integer Dim intJohn As Integer Dim intAverage As Integer 'assign input to variables Integer.TryParse (txtAllen.Text, intAllen) Integer.TryParse (txtPeter.Text, intPeter) Integer.TryParse (txtSmith.Text, intSmith) Integer.TryParse (txtJohn.Text, intJohn) ' caculate average intAverage = (intAllen + intPeter + intSmith + intJohn) /
Visual Basic Programming and Pseudocode Objective of this project is to develop the following applications: Calculating sales tax on a sale Converting from Fahrenheit to Celsius Calculate a total bulk sales using number of units and price per units. Calculating sales tax on a sale This paper presents an application to calculate a sale tax. The sale tax rate is 6.48% based on the current rate in the United States. Pseudocode Output: Sales tax Input: annual sale Percentage of tax Algorithms enter
Visual Basic Programming and Algorithm Solution to Chapter 5 Exercise Code of Net Pay Project ' Purpose: To display Net Pay ' Programmer: on Public Class Form1 Private Sub-Label1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub-Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub-Label2_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click End Sub Private Sub-Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs)
..now requires understanding and manipulating the processes used to create messages in the modern world" (Adams & Hamm, 2000, p. 22) in fact the student is expected to be able to decode the information from various types of media. However the equally important point is also made that this expanding definition of what literacy comprises does not "...diminish the importance of traditional reading and writing skills; rather, it recognizes the
, 2004, p. 27) Yet, really folks, this idea of the nation as dislikable came long before Bush and will likely continue long into the future. One of the biggest hopes of the nation, for this new "administration" is that the image of the U.S. will be reclaimed and she will be welcomed back into international relations with open arms. As a South Korean living in America my sentiment on
Despite having a licensed special needs teacher and a near-full-time aide, there were simply too many students needing attention and instruction for the two severely visually impaired students in the classroom to receive the level of individualized attention and instruction that was truly necessary. There was an assortment of materials, including a wide array of books in Braille and one Braille writing machine for each of the two students
Our semester plans gives you unlimited, unrestricted access to our entire library of resources —writing tools, guides, example essays, tutorials, class notes, and more.
Get Started Now