Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
If TextBox3.Text = "1" Then TextBox4.Text = "2:00"
If TextBox3.Text = "1" Then
Else : TextBox4.Text = "Error"
End If
If TextBox3.Text = "2" Then TextBox4.Text = "3:00"
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged
If Val(TextBox4.Text) >= Val(TextBox6.Text) Then
TextBox9.Text = "Pass"
Else
TextBox9.Text = "Fail"
End If
If TextBox6.Text = "Over Day" Then TextBox9.Text = "Over"
End Sub
Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
End Sub
Private Sub TextBox12_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox12.TextChanged
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged
Dim a As Single
a = Val(TextBox7.Text) - Val(TextBox5.Text)
If TextBox12.Text = TextBox13.Text Then
TextBox6.Text = a
Else
TextBox6.Text = "Over Day"
End If
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
setupScreen()
End Sub
Sub setupScreen()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
End Sub
Private Sub Button16_Click() Handles Button16.Click
End
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
End Sub
Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
End Sub
Private Sub Button15_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button15.Click
Dim Conn As System.Data.OleDb.OleDbConnection
Dim objCmd As System.Data.OleDb.OleDbCommand
Dim strConnString As String
strConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database1.accdb"
Conn = New System.Data.OleDb.OleDbConnection(strConnString)
Conn.Open()
Dim comm As String = "Insert INTO Table2 (Log ID,Branch,Severity,No Hour,Open Date,Open Time,Time Receive,Close Date,Close Time,Time Usage,Over SLA,Technical,Description) "
comm &= " VALUES ('" & TextBox1.Text & "',"
comm &= "'" & TextBox2.Text & "',"
comm &= "'" & TextBox3.Text & "')"
comm &= "'" & TextBox4.Text & "')"
comm &= "'" & TextBox12.Text & "')"
comm &= "'" & TextBox5.Text & "')"
comm &= "'" & TextBox8.Text & "')"
comm &= "'" & TextBox13.Text & "')"
comm &= "'" & TextBox7.Text & "')"
comm &= "'" & TextBox6.Text & "')"
comm &= "'" & TextBox9.Text & "')"
comm &= "'" & TextBox10.Text & "')"
comm &= "'" & TextBox11.Text & "')"
Dim command As New OleDbCommand(comm, Conn)
Try
command.ExecuteNonQuery()
MessageBox.Show("Connect OK")
Conn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
objCmd = Nothing
Conn = Nothing
End Sub
End Class