acctg

download acctg

If you can't read please download the document

description

ac

Transcript of acctg

Public Class Form2 _ Public Shared Function BitBlt(ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, _ ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As Integer) As Long End Function 'get the screenshot Private memoryImage As Bitmap Private Sub CaptureScreen() Dim mygraphics As Graphics = Me.Panel2.CreateGraphics() Dim s As Size = Me.Panel2.ClientSize memoryImage = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel2.ClientRectangle.Width, Me.Panel2.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub ' _ ' Public Shared Function BitBlt2(ByVal hdcDest2 As IntPtr, ByVal nXDest2 As Integer, ByVal nYDest2 As Integer, ByVal nWidth2 As Integer, ByVal nHeight2 As Integer, ByVal hdcSrc2 As IntPtr, _ ' ByVal nXSrc2 As Integer, ByVal nYSrc2 As Integer, ByVal dwRop2 As Integer) As Long ' End Function 'get the screenshot Private memoryImage2 As Bitmap Private Sub CaptureScreen2() Dim mygraphics As Graphics = Me.Panel12.CreateGraphics() Dim s As Size = Me.Panel12.Size memoryImage2 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage2) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel12.ClientRectangle.Width, Me.Panel12.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage3 As Bitmap Private Sub CaptureScreen3() Dim mygraphics As Graphics = Me.Panel14.CreateGraphics() Dim s As Size = Me.Panel14.Size memoryImage3 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage3) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel14.ClientRectangle.Width, Me.Panel14.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage4 As Bitmap Private Sub CaptureScreen4() Dim mygraphics As Graphics = Me.Panel17.CreateGraphics() Dim s As Size = Me.Panel17.Size memoryImage4 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage4) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel17.ClientRectangle.Width, Me.Panel17.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage5 As Bitmap Private Sub CaptureScreen5() Dim mygraphics As Graphics = Me.Panel18.CreateGraphics() Dim s As Size = Me.Panel18.Size memoryImage5 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage5) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel18.ClientRectangle.Width, Me.Panel18.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage6 As Bitmap Private Sub CaptureScreen6() Dim mygraphics As Graphics = Me.Panel19.CreateGraphics() Dim s As Size = Me.Panel19.Size memoryImage6 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage6) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel19.ClientRectangle.Width, Me.Panel19.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage7 As Bitmap Private Sub CaptureScreen7() Dim mygraphics As Graphics = Me.Panel21.CreateGraphics() Dim s As Size = Me.Panel21.Size memoryImage7 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage7) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel21.ClientRectangle.Width, Me.Panel21.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage8 As Bitmap Private Sub CaptureScreen8() Dim mygraphics As Graphics = Me.Panel20.CreateGraphics() Dim s As Size = Me.Panel20.Size memoryImage8 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage8) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel20.ClientRectangle.Width, Me.Panel20.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage9 As Bitmap Private Sub CaptureScreen9() Dim mygraphics As Graphics = Me.Panel24.CreateGraphics() Dim s As Size = Me.Panel24.Size memoryImage9 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage9) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel24.ClientRectangle.Width, Me.Panel24.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage10 As Bitmap Private Sub CaptureScreen10() Dim mygraphics As Graphics = Me.Panel25.CreateGraphics() Dim s As Size = Me.Panel25.Size memoryImage10 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage10) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel25.ClientRectangle.Width, Me.Panel25.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage11 As Bitmap Private Sub CaptureScreen11() Dim mygraphics As Graphics = Me.Panel26.CreateGraphics() Dim s As Size = Me.Panel26.Size memoryImage11 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage11) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel26.ClientRectangle.Width, Me.Panel26.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage12 As Bitmap Private Sub CaptureScreen12() Dim mygraphics As Graphics = Me.Panel27.CreateGraphics() Dim s As Size = Me.Panel27.Size memoryImage12 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage12) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel27.ClientRectangle.Width, Me.Panel27.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private memoryImage13 As Bitmap Private Sub CaptureScreen13() Dim mygraphics As Graphics = Me.Panel29.CreateGraphics() Dim s As Size = Me.Panel29.Size memoryImage13 = New Bitmap(s.Width, s.Height, mygraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage13) Dim dc1 As IntPtr = mygraphics.GetHdc() Dim dc2 As IntPtr = memoryGraphics.GetHdc() BitBlt(dc2, 0, 0, Me.Panel29.ClientRectangle.Width, Me.Panel29.ClientRectangle.Height, dc1, _ 0, 0, 13369376) mygraphics.ReleaseHdc(dc1) memoryGraphics.ReleaseHdc(dc2) End Sub Private Sub LoadAccountData(Query As String) OpenDBConnection() With dbAdapter .SelectCommand = dbConn.CreateCommand .SelectCommand.CommandText = Query .SelectCommand.ExecuteReader() End With CloseDBConnection() dbDataSet = New DataSet("DataSet_Accounts") dbAdapter.Fill(dbDataSet, "DataSet_Accounts") With DataGridView1 .DataSource = dbDataSet .DataMember = "DataSet_Accounts" .Refresh() End With End Sub Private Sub LoadAccountData2(Query2 As String) OpenDBConnection2() With dbAdapter2 .SelectCommand = dbConn2.CreateCommand .SelectCommand.CommandText = Query2 .SelectCommand.ExecuteReader() End With CloseDBConnection2() dbDataSet2 = New DataSet("DataSet_Accounts2") dbAdapter2.Fill(dbDataSet2, "DataSet_Accounts2") With DataGridView2 .DataSource = dbDataSet2 .DataMember = "DataSet_Accounts2" .Refresh() End With End Sub Private Sub LoadAccountData3(Query3 As String) OpenDBConnection3() With dbAdapter3 .SelectCommand = dbConn3.CreateCommand .SelectCommand.CommandText = Query3 .SelectCommand.ExecuteReader() End With CloseDBConnection3() dbDataSet3 = New DataSet("DataSet_Accounts3") dbAdapter3.Fill(dbDataSet3, "DataSet_Accounts3") With DataGridView3 .DataSource = dbDataSet3 .DataMember = "DataSet_Accounts3" .Refresh() End With End Sub Private Sub LoadAccountData4(Query4 As String) OpenDBConnection4() With dbAdapter4 .SelectCommand = dbConn4.CreateCommand .SelectCommand.CommandText = Query4 .SelectCommand.ExecuteReader() End With CloseDBConnection4() dbDataSet4 = New DataSet("DataSet_Accounts4") dbAdapter4.Fill(dbDataSet4, "DataSet_Accounts4") With DataGridView4 .DataSource = dbDataSet4 .DataMember = "DataSet_Accounts4" .Refresh() End With End Sub Private Sub LoadAccountData5(Query5 As String) OpenDBConnection5() With dbAdapter5 .SelectCommand = dbConn5.CreateCommand .SelectCommand.CommandText = Query5 .SelectCommand.ExecuteReader() End With CloseDBConnection5() dbDataSet5 = New DataSet("DataSet_Accounts5") dbAdapter5.Fill(dbDataSet5, "DataSet_Accounts5") With DataGridView5 .DataSource = dbDataSet5 .DataMember = "DataSet_Accounts5" .Refresh() End With End Sub Private Sub LoadAccountData6(Query6 As String) OpenDBConnection6() With dbAdapter6 .SelectCommand = dbConn6.CreateCommand .SelectCommand.CommandText = Query6 .SelectCommand.ExecuteReader() End With CloseDBConnection6() dbDataSet6 = New DataSet("DataSet_Accounts6") dbAdapter6.Fill(dbDataSet6, "DataSet_Accounts6") With DataGridView6 .DataSource = dbDataSet6 .DataMember = "DataSet_Accounts6" .Refresh() End With End Sub Private Sub LoadAccountData7(Query7 As String) OpenDBConnection7() With dbAdapter7 .SelectCommand = dbConn7.CreateCommand .SelectCommand.CommandText = Query7 .SelectCommand.ExecuteReader() End With CloseDBConnection7() dbDataSet7 = New DataSet("DataSet_Accounts7") dbAdapter7.Fill(dbDataSet7, "DataSet_Accounts7") With DataGridView7 .DataSource = dbDataSet7 .DataMember = "DataSet_Accounts7" .Refresh() End With End Sub Private Sub LoadAccountData8(Query8 As String) OpenDBConnection8() With dbAdapter8 .SelectCommand = dbConn8.CreateCommand .SelectCommand.CommandText = Query8 .SelectCommand.ExecuteReader() End With CloseDBConnection8() dbDataSet8 = New DataSet("DataSet_Accounts8") dbAdapter8.Fill(dbDataSet8, "DataSet_Accounts8") With DataGridView8 .DataSource = dbDataSet8 .DataMember = "DataSet_Accounts8" .Refresh() End With End Sub Private Sub LoadAccountData9(Query9 As String) OpenDBConnection9() With dbAdapter9 .SelectCommand = dbConn9.CreateCommand .SelectCommand.CommandText = Query9 .SelectCommand.ExecuteReader() End With CloseDBConnection9() dbDataSet9 = New DataSet("DataSet_Accounts9") dbAdapter9.Fill(dbDataSet9, "DataSet_Accounts9") With DataGridView9 .DataSource = dbDataSet9 .DataMember = "DataSet_Accounts9" .Refresh() End With End Sub Private Sub LoadAccountData10(Query10 As String) OpenDBConnection10() With dbAdapter10 .SelectCommand = dbConn10.CreateCommand .SelectCommand.CommandText = Query10 .SelectCommand.ExecuteReader() End With CloseDBConnection10() dbDataSet10 = New DataSet("DataSet_Accounts10") dbAdapter10.Fill(dbDataSet10, "DataSet_Accounts10") With DataGridView10 .DataSource = dbDataSet10 .DataMember = "DataSet_Accounts10" .Refresh() End With End Sub Private Sub LoadAccountData11(Query11 As String) OpenDBConnection11() With dbAdapter11 .SelectCommand = dbConn11.CreateCommand .SelectCommand.CommandText = Query11 .SelectCommand.ExecuteReader() End With CloseDBConnection11() dbDataSet11 = New DataSet("DataSet_Accounts11") dbAdapter11.Fill(dbDataSet11, "DataSet_Accounts11") With DataGridView11 .DataSource = dbDataSet11 .DataMember = "DataSet_Accounts11" .Refresh() End With End Sub Private Sub LoadAccountData12(Query12 As String) OpenDBConnection12() With dbAdapter12 .SelectCommand = dbConn12.CreateCommand .SelectCommand.CommandText = Query12 .SelectCommand.ExecuteReader() End With CloseDBConnection12() dbDataSet12 = New DataSet("DataSet_Accounts12") dbAdapter12.Fill(dbDataSet12, "DataSet_Accounts12") With DataGridView12 .DataSource = dbDataSet12 .DataMember = "DataSet_Accounts12" .Refresh() End With End Sub Private Sub LoadAccountData13(Query13 As String) OpenDBConnection13() With dbAdapter13 .SelectCommand = dbConn13.CreateCommand .SelectCommand.CommandText = Query13 .SelectCommand.ExecuteReader() End With CloseDBConnection13() dbDataSet13 = New DataSet("DataSet_Accounts13") dbAdapter13.Fill(dbDataSet13, "DataSet_Accounts13") With DataGridView13 .DataSource = dbDataSet13 .DataMember = "DataSet_Accounts13" .Refresh() End With End Sub Private Sub LoadAccountData14(Query14 As String) OpenDBConnection14() With dbAdapter14 .SelectCommand = dbConn14.CreateCommand .SelectCommand.CommandText = Query14 .SelectCommand.ExecuteReader() End With CloseDBConnection14() dbDataSet14 = New DataSet("DataSet_Accounts14") dbAdapter14.Fill(dbDataSet14, "DataSet_Accounts14") With DataGridView14 .DataSource = dbDataSet14 .DataMember = "DataSet_Accounts14" .Refresh() End With End Sub Private Sub LoadAccountData15(Query15 As String) OpenDBConnection15() With dbAdapter15 .SelectCommand = dbConn15.CreateCommand .SelectCommand.CommandText = Query15 .SelectCommand.ExecuteReader() End With CloseDBConnection15() dbDataSet15 = New DataSet("DataSet_Accounts15") dbAdapter15.Fill(dbDataSet15, "DataSet_Accounts15") With DataGridView15 .DataSource = dbDataSet15 .DataMember = "DataSet_Accounts15" .Refresh() End With End Sub Private Sub LoadAccountData16(Query16 As String) OpenDBConnection16() With dbAdapter16 .SelectCommand = dbConn16.CreateCommand .SelectCommand.CommandText = Query16 .SelectCommand.ExecuteReader() End With CloseDBConnection16() dbDataSet16 = New DataSet("DataSet_Accounts16") dbAdapter16.Fill(dbDataSet16, "DataSet_Accounts16") With DataGridView16 .DataSource = dbDataSet16 .DataMember = "DataSet_Accounts16" .Refresh() End With End Sub Private Sub LoadAccountData17(Query17 As String) OpenDBConnection17() With dbAdapter17 .SelectCommand = dbConn17.CreateCommand .SelectCommand.CommandText = Query17 .SelectCommand.ExecuteReader() End With CloseDBConnection17() dbDataSet17 = New DataSet("DataSet_Accounts17") dbAdapter17.Fill(dbDataSet17, "DataSet_Accounts17") With DataGridView17 .DataSource = dbDataSet17 .DataMember = "DataSet_Accounts17" .Refresh() End With End Sub Private Sub LoadAccountData18(Query18 As String) OpenDBConnection18() With dbAdapter18 .SelectCommand = dbConn18.CreateCommand .SelectCommand.CommandText = Query18 .SelectCommand.ExecuteReader() End With CloseDBConnection18() dbDataSet18 = New DataSet("DataSet_Accounts18") dbAdapter18.Fill(dbDataSet18, "DataSet_Accounts18") With DataGridView18 .DataSource = dbDataSet18 .DataMember = "DataSet_Accounts18" .Refresh() End With End Sub Private Sub LoadAccountData19(Query19 As String) OpenDBConnection19() With dbAdapter19 .SelectCommand = dbConn19.CreateCommand .SelectCommand.CommandText = Query19 .SelectCommand.ExecuteReader() End With CloseDBConnection19() dbDataSet19 = New DataSet("DataSet_Accounts19") dbAdapter19.Fill(dbDataSet19, "DataSet_Accounts19") With DataGridView21 .DataSource = dbDataSet19 .DataMember = "DataSet_Accounts19" .Refresh() End With End Sub Private Sub LoadAccountData20(Query20 As String) OpenDBConnection20() With dbAdapter20 .SelectCommand = dbConn20.CreateCommand .SelectCommand.CommandText = Query20 .SelectCommand.ExecuteReader() End With CloseDBConnection20() dbDataSet20 = New DataSet("DataSet_Accounts20") dbAdapter20.Fill(dbDataSet20, "DataSet_Accounts20") With DataGridView22 .DataSource = dbDataSet20 .DataMember = "DataSet_Accounts20" .Refresh() End With End Sub Private Sub LoadAccountData21(Query21 As String) OpenDBConnection21() With dbAdapter21 .SelectCommand = dbConn21.CreateCommand .SelectCommand.CommandText = Query21 .SelectCommand.ExecuteReader() End With CloseDBConnection21() dbDataSet21 = New DataSet("DataSet_Accounts21") dbAdapter21.Fill(dbDataSet21, "DataSet_Accounts21") With DataGridView23 .DataSource = dbDataSet21 .DataMember = "DataSet_Accounts21" .Refresh() End With End Sub Public DrAmtRC, CrAmtRC As Integer Public CrRC, DrRC As String Public ctr As Integer Public ctr2 As Integer Public ctr3 As Integer Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged If RadioButton1.Checked = True Then Panel5.Enabled = True RadioButton1.ForeColor = Color.Yellow txtPOnum.Focus() End If If RadioButton1.Checked = False Then RadioButton1.ForeColor = Color.Black Panel5.Enabled = False txtBSnum.Clear() txtDRnum.Clear() txtInvnum.Clear() txtPOnum.Clear() End If End Sub Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged If RadioButton2.Checked = True Then Panel6.Enabled = True RadioButton2.ForeColor = Color.Yellow txtBSnum.Focus() End If If RadioButton2.Checked = False Then RadioButton2.ForeColor = Color.Black Panel6.Enabled = False txtBSnum.Clear() txtDRnum.Clear() txtInvnum.Clear() txtPOnum.Clear() txtPOnum.Focus() End If End Sub Private Sub Form2_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed OpenDBConnection21() With dbAdapter21 .UpdateCommand = dbConn21.CreateCommand .UpdateCommand.CommandText = "UPDATE Table1 SET CV_num='" & Val(lblCvno.Text) & "',OR_num='" & Val(lblORnumRC.Text) & "',JV_num='" & Val(lblJVnum.Text) & "' WHERE ID=1;" .UpdateCommand.ExecuteNonQuery() End With CloseDBConnection21() End Sub Sub Form2_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If (e.KeyCode = Keys.F9) Then Form3.Show() End If If (e.KeyCode = Keys.F10) Then MsgBox("Developed by Marvin John Mendoza.", MsgBoxStyle.Information, SystemInformation.UserName) End If If (e.KeyCode = Keys.F12) Then MsgBox("All rights reserved. CCS", MsgBoxStyle.Information, SystemInformation.UserName) End If If (e.KeyCode = Keys.F5) Then UpdateCDJ() UpdateCRJ() UpdateGJ() UpdateTApg1() UpdateTApg2() UpdateTApg3() UpdateTApg4() UpdateTB() UpdateIS() UpdateBS() End If End Sub Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim height As Integer = Screen.PrimaryScreen.Bounds.Height Dim width As Integer = Screen.PrimaryScreen.Bounds.Width ' Me.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size LoadAccountData21("SELECT CV_Num,OR_num,JV_num FROM Table1;") ctr = DataGridView23.Item(0, 0).Value ctr2 = DataGridView23.Item(1, 0).Value ctr3 = DataGridView23.Item(2, 0).Value lblJVnum.Text = ctr3 lblORnumRC.Text = ctr2 lblCvno.Text = ctr RadioButton1.Checked = True txtPOnum.Focus() RadioButton2.ForeColor = Color.Black LoadAccountData("SELECT Date_CDJ,CV_No,Check_No,Payor,Cash,Acct_R,Supplies,Equipment,Acct_P,Capital,Drawing,Fees,Wages_Exp,Ads_Exp,Rent_Exp,Tel_Exp,Electricity_Exp,Misc_Exp FROM Table1;") 'LoadAccountData("SELECT Date,CV_No,Check_No,Payor,Cash,Acct_R,Supplies,Equipment,Acctg_P,Capital,Drawing,Fees,Wages_Exp,Tel_Exp,Electricity_Exp,Misc_Exp FROM Table1;") LoadAccountData2("SELECT Date_CRJ,OR_No,Payor,Cash,Acct_R,Supplies,Equipment,Acct_P,Capital,Drawing,Fees,Wages_Exp,Ads_Exp,Rent_Exp,Tel_Exp,Electricity_Exp,Misc_Exp FROM Table1;") LoadAccountData3("SELECT Date_GJ,Particulars,Debit,Credit FROM Table1;") LoadAccountData4("SELECT Account_Title,Debit_Balance,Credit_Balance FROM Table1;") LoadAccountData5("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData6("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData7("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData8("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData9("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData10("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData11("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData12("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData13("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData14("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData15("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData16("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData17("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData18("SELECT Date_Dr,Debit,Date_Cr,Credit FROM Table1;") LoadAccountData19("SELECT Account_Title,Debit_Balance,Credit_Balance FROM Table1;") LoadAccountData20("SELECT Account_Title,Debit_Balance,Credit_Balance FROM Table1;") UpdateCDJ() UpdateCRJ() UpdateGJ() UpdateTApg1() UpdateTApg2() UpdateTApg3() UpdateTApg4() UpdateTB() UpdateIS() UpdateBS() End Sub Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click RadioButton1.Checked = True RadioButton2.ForeColor = Color.Black txtBSnum.Clear() txtDRnum.Clear() txtInvnum.Clear() txtPOnum.Clear() btnCreate.Enabled = False End Sub Private Sub btnCreate_Click(sender As Object, e As EventArgs) Handles btnCreate.Click If RadioButton1.Checked = True Then If IsNumeric(txtPOnum.Text) = False Or IsNumeric(txtInvnum.Text) = False Or IsNumeric(txtPOnum.Text) = False Then MsgBox("Error!" + vbCr + "Please Enter Numerical Value.", MsgBoxStyle.Exclamation, "Purchases") Else btnCancel.PerformClick() Panel1.Enabled = True Panel4.Enabled = False ' btnAdd.Enabled = False ' btnCancel.Enabled = False btnDone.Enabled = False btnPreview.Enabled = False btnPrint.Enabled = False txtCrdit.Text = "Cash" End If End If If RadioButton2.Checked = True Then If IsNumeric(txtBSnum.Text) = False Then MsgBox("Error!" + vbCr + "Please Enter Numerical Value.", MsgBoxStyle.Exclamation, "Expense") Else btnCancel.PerformClick() Panel1.Enabled = True Panel4.Enabled = False ' btnAdd.Enabled = True ' btnCancel.Enabled = False btnDone.Enabled = False btnPreview.Enabled = False btnPrint.Enabled = False txtCrdit.Text = "Cash" End If End If End Sub Private Sub txtPOnum_TextChanged(sender As Object, e As EventArgs) Handles txtPOnum.TextChanged If txtPOnum.Text.Trim "" And txtInvnum.Text.Trim "" And txtDRnum.Text.Trim "" Then btnCreate.Enabled = True End If If txtPOnum.Text.Trim = "" Or txtInvnum.Text.Trim = "" Or txtDRnum.Text.Trim = "" Then btnCreate.Enabled = False End If End Sub Private Sub txtInvnum_TextChanged(sender As Object, e As EventArgs) Handles txtInvnum.TextChanged If txtPOnum.Text.Trim "" And txtInvnum.Text.Trim "" And txtDRnum.Text.Trim "" Then btnCreate.Enabled = True End If If txtPOnum.Text.Trim = "" Or txtInvnum.Text.Trim = "" Or txtDRnum.Text.Trim = "" Then btnCreate.Enabled = False End If End Sub Private Sub txtDRnum_TextChanged(sender As Object, e As EventArgs) Handles txtDRnum.TextChanged If txtPOnum.Text.Trim "" And txtInvnum.Text.Trim "" And txtDRnum.Text.Trim "" Then btnCreate.Enabled = True End If If txtPOnum.Text.Trim = "" Or txtInvnum.Text.Trim = "" Or txtDRnum.Text.Trim = "" Then btnCreate.Enabled = False End If End Sub Private Sub txtBSnum_TextChanged(sender As Object, e As EventArgs) Handles txtBSnum.TextChanged If txtBSnum.Text.Trim "" Then btnCreate.Enabled = True End If If txtBSnum.Text.Trim = "" Then btnCreate.Enabled = False End If End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles btnDone.Click ' lblCvno.Text = lblCvno.Text + 1 OpenDBConnection() With dbAdapter .InsertCommand = dbConn.CreateCommand If ComboBox1.SelectedIndex = 2 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Supplies) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 3 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Equipment) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 4 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Acct_P) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 6 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Drawing) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 8 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Wages_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 9 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Ads_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 10 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Rent_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 11 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Tel_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 12 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Electricity_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If If ComboBox1.SelectedIndex = 13 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Misc_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" End If .InsertCommand.ExecuteNonQuery() End With CloseDBConnection() If txtCrdit.Text = "Cash" Then OpenDBConnection5() With dbAdapter5 .InsertCommand = dbConn5.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmt2.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection5() End If If ComboBox1.SelectedIndex = 2 Then OpenDBConnection7() With dbAdapter7 .InsertCommand = dbConn7.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection7() End If If ComboBox1.SelectedIndex = 3 Then OpenDBConnection8() With dbAdapter8 .InsertCommand = dbConn8.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection8() End If If ComboBox1.SelectedIndex = 4 Then OpenDBConnection9() With dbAdapter9 .InsertCommand = dbConn9.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection9() End If If ComboBox1.SelectedIndex = 6 Then OpenDBConnection11() With dbAdapter11 .InsertCommand = dbConn11.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection11() End If If ComboBox1.SelectedIndex = 8 Then OpenDBConnection13() With dbAdapter13 .InsertCommand = dbConn13.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection13() End If If ComboBox1.SelectedIndex = 9 Then OpenDBConnection14() With dbAdapter14 .InsertCommand = dbConn14.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection14() End If If ComboBox1.SelectedIndex = 10 Then OpenDBConnection15() With dbAdapter15 .InsertCommand = dbConn15.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection15() End If If ComboBox1.SelectedIndex = 11 Then OpenDBConnection16() With dbAdapter16 .InsertCommand = dbConn16.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection16() End If If ComboBox1.SelectedIndex = 12 Then OpenDBConnection17() With dbAdapter17 .InsertCommand = dbConn17.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection17() End If If ComboBox1.SelectedIndex = 13 Then OpenDBConnection18() With dbAdapter18 .InsertCommand = dbConn18.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDate.Text.Trim & "', '" & Val(txtAmount.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection18() End If btnRefresh.PerformClick() ' OpenDBConnection5() 'With dbAdapter5 ' .InsertCommand = dbConn5.CreateCommand ' If ComboBox1.SelectedIndex = 2 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Supplies) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 3 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Equipment) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 4 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Acct_P) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 6 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Drawing) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 8 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Wages_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 9 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Ads_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 10 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Rent_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 11 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Tel_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 12 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Electricity_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' If ComboBox1.SelectedIndex = 13 Then ' .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CDJ,CV_No,Check_No,Payor,Cash,Misc_Exp) VALUES('" & txtDate.Text.Trim & "','" & lblCvno.Text & "','" & txtCN.Text & "','" & txtPayor.Text & "','" & Val(txtAmt2.Text) & "','" & Val(txtAmount.Text) & "');" ' End If ' .InsertCommand.ExecuteNonQuery() 'End With 'CloseDBConnection5() lblCvno.Text = lblCvno.Text + 1 Panel4.Enabled = True txtCN.Clear() 'txtCrdit.Clear() txtDate.Clear() DateTimePicker1.ResetText() ' txtDebit.Clear() txtPayor.Clear() txtAddress.Clear() txtAmount.Clear() txtAmt2.Clear() ComboBox1.Text = Nothing Panel1.Enabled = False lblAddress.Text = "-" lblAmount.Text = "-" lblATcr.Text = "-" lblATdr.Text = "-" lblCr.Text = "-" lblDate.Text = "-" lblDr.Text = "-" lblPayor.Text = "-" ' btnRefresh.PerformClick() End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnAdd.Click If ComboBox1.SelectedIndex = -1 Then MsgBox("Enter Account Title!", MsgBoxStyle.Exclamation, "CDJ") ComboBox1.Text = Nothing ComboBox1.Focus() Exit Sub End If If ComboBox1.SelectedIndex = 0 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CDJ") ComboBox1.Text = Nothing ComboBox1.Focus() Exit Sub End If If ComboBox1.SelectedIndex = 1 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CDJ") ComboBox1.Text = Nothing ComboBox1.Focus() Exit Sub End If If ComboBox1.SelectedIndex = 5 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CDJ") ComboBox1.Text = Nothing ComboBox1.Focus() Exit Sub End If If ComboBox1.SelectedIndex = 7 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CDJ") ComboBox1.Text = Nothing ComboBox1.Focus() Exit Sub End If txtDate.Text = DateTimePicker1.Text lblchknum.Text = txtCN.Text lblAddress.Text = txtAddress.Text lblAmount.Text = txtAmount.Text lblATcr.Text = txtCrdit.Text lblATdr.Text = ComboBox1.Text lblCr.Text = txtAmt2.Text lblDate.Text = txtDate.Text lblDr.Text = txtAmount.Text lblPayor.Text = txtPayor.Text 'txtCN.Clear() 'txtCrdit.Clear() 'txtDate.Clear() 'ComboBox1.Text = Nothing '' txtDebit.Clear() 'txtPayor.Clear() 'txtAddress.Clear() 'txtAmount.Clear() btnAdd.Enabled = True btnDone.Enabled = True btnPreview.Enabled = True btnPrint.Enabled = True End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnExit.Click Panel4.Enabled = True txtCN.Clear() txtAmt2.Clear() ' txtCrdit.Clear() txtDate.Clear() DateTimePicker1.ResetText() ' txtDebit.Clear() txtPayor.Clear() txtAddress.Clear() txtAmount.Clear() ComboBox1.Text = Nothing Panel1.Enabled = False lblAddress.Text = "-" lblAmount.Text = "-" lblATcr.Text = "-" lblATdr.Text = "-" lblCr.Text = "-" lblDate.Text = "-" lblDr.Text = "-" lblPayor.Text = "-" End Sub Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage CaptureScreen() e.Graphics.DrawImage(memoryImage, 0, 0) End Sub Private Sub btnPrint_Click(sender As Object, e As EventArgs) Handles btnPrint.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) prn.DefaultPageSettings = pageSettings CaptureScreen() PrintDocument1.DefaultPageSettings = pageSettings PrintDocument1.DefaultPageSettings.Landscape = True PrintDocument1.Print() ' Dim prn As New Printing.PrintDocument ' Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings ' pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) 'prn.DefaultPageSettings = pageSettings ' PrintDialog1.Document = PrintDocument1 ' PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings ' PrintDialog1.AllowSomePages = True ' If PrintDialog1.ShowDialog = DialogResult.OK Then 'PrintDocument1.DefaultPageSettings = pageSettings ' CaptureScreen() 'PrintDocument1.Print() 'End If End Sub Private Sub btnPreview_Click(sender As Object, e As EventArgs) Handles btnPreview.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) prn.DefaultPageSettings = pageSettings CaptureScreen() Dim i, count As Integer count = 5 For i = 1 To count 'Me.PrintPreviewDialog1.Add(Me.PrintDocument1) Next Me.PrintPreviewDialog1.Document = Me.PrintDocument1 PrintDocument1.DefaultPageSettings.Landscape = True PrintDocument1.DefaultPageSettings = pageSettings Me.PrintPreviewDialog1.ShowDialog() End Sub Private Sub btnClearRC_Click(sender As Object, e As EventArgs) Handles btnClearRC.Click txtCrAmtRC.Clear() ComboBox2.Text = Nothing txtDateCR.Clear() DateTimePicker2.ResetText() txtDrAmtRC.Clear() txtDrRC.Text = "Cash" txtPayorRC.Clear() txtPtrRC.Clear() txtDateCR.Focus() End Sub Private Sub txtDateCR_TextChanged(sender As Object, e As EventArgs) Handles txtDateCR.TextChanged 'If txtCrAmtRC.Text "" And txtDateCR.Text "" And txtDrAmtRC.Text "" And ' txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then ' btnCreateRC.Enabled = True 'End If 'If txtCrAmtRC.Text = "" Or txtDateCR.Text = "" Or txtDrAmtRC.Text = "" Or ' txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then ' btnCreateRC.Enabled = False 'End If End Sub Private Sub txtPayorRC_TextChanged(sender As Object, e As EventArgs) Handles txtPayorRC.TextChanged If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub txtDrRC_TextChanged(sender As Object, e As EventArgs) Handles txtDrRC.TextChanged If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub txtDrAmtRC_TextChanged(sender As Object, e As EventArgs) Handles txtDrAmtRC.TextChanged If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub txtCrRC_TextChanged(sender As Object, e As EventArgs) If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub txtCrAmtRC_TextChanged(sender As Object, e As EventArgs) Handles txtCrAmtRC.TextChanged If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub txtPtrRC_TextChanged(sender As Object, e As EventArgs) Handles txtPtrRC.TextChanged If txtCrAmtRC.Text "" And txtDrAmtRC.Text "" And txtDrRC.Text "" And txtPayorRC.Text "" And txtPtrRC.Text "" And ComboBox2.SelectedIndex -1 Then btnCreateRC.Enabled = True End If If txtCrAmtRC.Text = "" Or txtDrAmtRC.Text = "" Or txtDrRC.Text = "" Or txtPayorRC.Text = "" Or txtPtrRC.Text = "" Or ComboBox2.SelectedIndex = -1 Then btnCreateRC.Enabled = False End If End Sub Private Sub btnCreateRC_Click(sender As Object, e As EventArgs) Handles btnCreateRC.Click Panel10.Enabled = True btnExitRC.Enabled = False End Sub Private Sub TabPage7_Click(sender As Object, e As EventArgs) Handles TabPage7.Click txtPOnum.Focus() End Sub Private Sub btnAddRC_Click(sender As Object, e As EventArgs) Handles btnAddRC.Click If ComboBox2.SelectedIndex = -1 Then MsgBox("Enter Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 0 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 2 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 3 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 4 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 6 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 8 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 9 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 10 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 11 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 12 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If If ComboBox2.SelectedIndex = 13 Then MsgBox("Invalid Account Title!", MsgBoxStyle.Exclamation, "CRJ") ComboBox2.Text = Nothing ComboBox2.Focus() Exit Sub End If DrAmtRC = txtDrAmtRC.Text CrAmtRC = txtCrAmtRC.Text CrRC = ComboBox2.Text DrRC = txtDrRC.Text txtDateCR.Text = DateTimePicker2.Text lblDateRC.Text = txtDateCR.Text lblAmtRC.Text = txtCrAmtRC.Text lblPayorRC.Text = txtPayorRC.Text lblPrtRC.Text = txtPtrRC.Text btnDoneRC.Enabled = True btnPreviewRC.Enabled = True btnPrintRC.Enabled = True btnExitRC.Enabled = True 'btnClearRC.PerformClick() 'txtDrRC.Clear() 'Panel7.Enabled = False 'btnAddRC.Enabled = False End Sub Private Sub btnDoneRC_Click(sender As Object, e As EventArgs) Handles btnDoneRC.Click 'lblORnumRC.Text = lblORnumRC.Text + 1 OpenDBConnection2() With dbAdapter2 .InsertCommand = dbConn2.CreateCommand If ComboBox2.SelectedIndex = 1 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CRJ,OR_No,Payor,Cash,Acct_R) VALUES('" & txtDateCR.Text.Trim & "','" & lblORnumRC.Text & "','" & txtPayorRC.Text & "','" & DrAmtRC & "','" & CrAmtRC & "');" End If If ComboBox2.SelectedIndex = 5 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CRJ,OR_No,Payor,Cash,Capital) VALUES('" & txtDateCR.Text.Trim & "','" & lblORnumRC.Text & "','" & txtPayorRC.Text & "','" & DrAmtRC & "','" & CrAmtRC & "');" End If If ComboBox2.SelectedIndex = 7 Then .InsertCommand.CommandText = "INSERT INTO Table1 (Date_CRJ,OR_No,Payor,Cash,Fees) VALUES('" & txtDateCR.Text.Trim & "','" & lblORnumRC.Text & "','" & txtPayorRC.Text & "','" & DrAmtRC & "','" & CrAmtRC & "');" End If .InsertCommand.ExecuteNonQuery() End With CloseDBConnection2() If txtDrRC.Text = "Cash" Then OpenDBConnection5() With dbAdapter5 .InsertCommand = dbConn5.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateCR.Text.Trim & "', '" & Val(txtDrAmtRC.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection5() End If If ComboBox2.SelectedIndex = 1 Then OpenDBConnection6() With dbAdapter6 .InsertCommand = dbConn6.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateCR.Text.Trim & "', '" & Val(txtCrAmtRC.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection6() End If If ComboBox2.SelectedIndex = 5 Then OpenDBConnection10() With dbAdapter10 .InsertCommand = dbConn10.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateCR.Text.Trim & "', '" & Val(txtCrAmtRC.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection10() End If If ComboBox2.SelectedIndex = 7 Then OpenDBConnection12() With dbAdapter12 .InsertCommand = dbConn12.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateCR.Text.Trim & "', '" & Val(txtCrAmtRC.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection12() End If lblORnumRC.Text = lblORnumRC.Text + 1 txtCrAmtRC.Clear() ComboBox2.Text = Nothing lblDateRC.Text = "-" txtDrAmtRC.Clear() lblAmtRC.Text = "-" lblPayorRC.Text = "-" lblPrtRC.Text = "-" btnClearRC.PerformClick() btnAddRC.Enabled = True btnPreviewRC.Enabled = False btnDoneRC.Enabled = False btnExitRC.Enabled = False btnPrintRC.Enabled = False Panel10.Enabled = False Panel7.Enabled = True txtDrRC.Text = "Cash" txtDateCR.Focus() End Sub Private Sub btnExitRC_Click(sender As Object, e As EventArgs) Handles btnExitRC.Click '= txtCrAmtRC.Text ' =txtCrRC.Text lblDateRC.Text = "-" ' = txtDrAmtRC.Text lblAmtRC.Text = "-" lblPayorRC.Text = "-" lblPrtRC.Text = "-" btnAddRC.Enabled = True btnPreviewRC.Enabled = False btnDoneRC.Enabled = False btnExitRC.Enabled = False btnPrintRC.Enabled = False Panel10.Enabled = False Panel7.Enabled = True txtDrRC.Text = "Cash" txtDateCR.Focus() End Sub Private Sub btnPreviewRC_Click(sender As Object, e As EventArgs) Handles btnPreviewRC.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 532, 576) prn.DefaultPageSettings = pageSettings CaptureScreen2() Dim i, count As Integer count = 5 For i = 1 To count 'Me.PrintPreviewDialog1.Add(Me.PrintDocument1) Next Me.PrintPreviewDialog2.Document = Me.PrintDocument2 'PrintDocument1.DefaultPageSettings.Landscape = True PrintDocument2.DefaultPageSettings = pageSettings Me.PrintPreviewDialog2.ShowDialog() End Sub Private Sub btnPrintRC_Click(sender As Object, e As EventArgs) Handles btnPrintRC.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 532, 576) prn.DefaultPageSettings = pageSettings CaptureScreen2() PrintDocument2.DefaultPageSettings = pageSettings PrintDocument2.Print() ' Dim prn As New Printing.PrintDocument ' Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings ' pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 532, 576) 'prn.DefaultPageSettings = pageSettings ' PrintDialog2.Document = PrintDocument2 ' PrintDialog2.PrinterSettings = PrintDocument2.PrinterSettings ' PrintDialog2.AllowSomePages = True ' If PrintDialog2.ShowDialog = DialogResult.OK Then 'PrintDocument2.DefaultPageSettings = pageSettings ' CaptureScreen() 'PrintDocument2.Print() 'End If End Sub Private Sub PrintDocument2_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument2.PrintPage CaptureScreen2() e.Graphics.DrawImage(memoryImage2, 0, 0) End Sub Private Sub btnPreviewJV_Click(sender As Object, e As EventArgs) Handles btnPreviewJV.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) prn.DefaultPageSettings = pageSettings CaptureScreen3() Dim i, count As Integer count = 5 For i = 1 To count 'Me.PrintPreviewDialog1.Add(Me.PrintDocument1) Next Me.PrintPreviewDialog3.Document = Me.PrintDocument3 'PrintDocument1.DefaultPageSettings.Landscape = True PrintDocument3.DefaultPageSettings = pageSettings Me.PrintPreviewDialog3.ShowDialog() End Sub Private Sub btnPrintJV_Click(sender As Object, e As EventArgs) Handles btnPrintJV.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) prn.DefaultPageSettings = pageSettings CaptureScreen3() PrintDocument3.DefaultPageSettings = pageSettings PrintDocument3.DefaultPageSettings.Landscape = True PrintDocument3.Print() ' Dim prn As New Printing.PrintDocument ' Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings ' pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) 'prn.DefaultPageSettings = pageSettings ' PrintDialog3.Document = PrintDocument3 ' PrintDialog3.PrinterSettings = PrintDocument3.PrinterSettings ' PrintDialog3.AllowSomePages = True ' If PrintDialog3.ShowDialog = DialogResult.OK Then 'PrintDocument3.DefaultPageSettings = pageSettings ' CaptureScreen3() 'PrintDocument3.Print() 'End If End Sub Private Sub PrintDocument3_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument3.PrintPage CaptureScreen3() e.Graphics.DrawImage(memoryImage3, 0, 0) End Sub Private Sub txtDateJV_TextChanged(sender As Object, e As EventArgs) Handles txtDateJV.TextChanged 'If txtDateJV.Text "" And txtAmtdrJV.Text "" And cboAtcrJV.Text "" And txtAmtcrJV.Text "" And cboATdrJV.Text "" Then ' btnCreateJV.Enabled = True 'End If 'If txtDateJV.Text = "" Or txtAmtdrJV.Text = "" Or cboAtcrJV.Text = "" Or txtAmtcrJV.Text = "" Or cboATdrJV.Text = "" Then ' btnCreateJV.Enabled = False 'End If End Sub Private Sub txtATdrJV_TextChanged(sender As Object, e As EventArgs) If txtAmtdrJV.Text "" And cboAtcrJV.Text "" And txtAmtcrJV.Text "" And cboATdrJV.Text "" Then btnCreateJV.Enabled = True End If If txtAmtdrJV.Text = "" Or cboAtcrJV.Text = "" Or txtAmtcrJV.Text = "" Or cboATdrJV.Text = "" Then btnCreateJV.Enabled = False End If End Sub Private Sub txtAmtdrJV_TextChanged(sender As Object, e As EventArgs) Handles txtAmtdrJV.TextChanged If txtAmtdrJV.Text "" And cboAtcrJV.Text "" And txtAmtcrJV.Text "" And cboATdrJV.Text "" Then btnCreateJV.Enabled = True End If If txtAmtdrJV.Text = "" Or cboAtcrJV.Text = "" Or txtAmtcrJV.Text = "" Or cboATdrJV.Text = "" Then btnCreateJV.Enabled = False End If End Sub Private Sub txtATcrJV_TextChanged(sender As Object, e As EventArgs) If txtAmtdrJV.Text "" And cboAtcrJV.Text "" And txtAmtcrJV.Text "" And cboATdrJV.Text "" Then btnCreateJV.Enabled = True End If If txtAmtdrJV.Text = "" Or cboAtcrJV.Text = "" Or txtAmtcrJV.Text = "" Or cboATdrJV.Text = "" Then btnCreateJV.Enabled = False End If End Sub Private Sub txtAmtcrJV_TextChanged(sender As Object, e As EventArgs) Handles txtAmtcrJV.TextChanged If txtAmtdrJV.Text "" And cboAtcrJV.Text "" And txtAmtcrJV.Text "" And cboATdrJV.Text "" Then btnCreateJV.Enabled = True End If If txtAmtdrJV.Text = "" Or cboAtcrJV.Text = "" Or txtAmtcrJV.Text = "" Or cboATdrJV.Text = "" Then btnCreateJV.Enabled = False End If End Sub Private Sub btnClearJV_Click(sender As Object, e As EventArgs) Handles btnClearJV.Click txtDateJV.Clear() DateTimePicker3.ResetText() cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing txtAmtcrJV.Clear() txtAmtdrJV.Clear() txtDateJV.Focus() End Sub Private Sub btnCreateJV_Click(sender As Object, e As EventArgs) Handles btnCreateJV.Click Panel13.Enabled = True Panel14.Enabled = True btnExitJV.Enabled = False End Sub Private Sub btnAddJV_Click(sender As Object, e As EventArgs) Handles btnAddJV.Click If cboAtcrJV.Text = cboATdrJV.Text Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboATdrJV.SelectedIndex = 0 And (cboAtcrJV.SelectedIndex = 2 Or cboAtcrJV.SelectedIndex = 3 Or cboAtcrJV.SelectedIndex = 4 Or cboAtcrJV.SelectedIndex = 6 Or cboAtcrJV.SelectedIndex = 8 Or cboAtcrJV.SelectedIndex = 9 Or cboAtcrJV.SelectedIndex = 10 Or cboAtcrJV.SelectedIndex = 11 Or cboAtcrJV.SelectedIndex = 12 Or cboAtcrJV.SelectedIndex = 13) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboAtcrJV.SelectedIndex = 0 And (cboATdrJV.SelectedIndex = 1 Or cboATdrJV.SelectedIndex = 5 Or cboATdrJV.SelectedIndex = 7) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboAtcrJV.SelectedIndex = 4 And (cboATdrJV.SelectedIndex = 0 Or cboATdrJV.SelectedIndex = 6 Or cboATdrJV.SelectedIndex = 1 Or cboATdrJV.SelectedIndex = 5 Or cboATdrJV.SelectedIndex = 7) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboAtcrJV.SelectedIndex = 5 And (cboATdrJV.SelectedIndex = 1 Or cboATdrJV.SelectedIndex = 2 Or cboATdrJV.SelectedIndex = 4 Or cboATdrJV.SelectedIndex = 6 Or cboATdrJV.SelectedIndex = 7 Or cboATdrJV.SelectedIndex = 8 Or cboATdrJV.SelectedIndex = 9 Or cboATdrJV.SelectedIndex = 10 Or cboATdrJV.SelectedIndex = 11 Or cboATdrJV.SelectedIndex = 12 Or cboATdrJV.SelectedIndex = 13) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboAtcrJV.SelectedIndex = 7 And (cboATdrJV.SelectedIndex = 2 Or cboATdrJV.SelectedIndex = 3 Or cboATdrJV.SelectedIndex = 4 Or cboATdrJV.SelectedIndex = 5 Or cboATdrJV.SelectedIndex = 6 Or cboATdrJV.SelectedIndex = 8 Or cboATdrJV.SelectedIndex = 9 Or cboATdrJV.SelectedIndex = 10 Or cboATdrJV.SelectedIndex = 11 Or cboATdrJV.SelectedIndex = 12 Or cboATdrJV.SelectedIndex = 13) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If cboATdrJV.SelectedIndex = 1 And (cboAtcrJV.SelectedIndex = 0 Or cboAtcrJV.SelectedIndex = 2 Or cboAtcrJV.SelectedIndex = 3 Or cboAtcrJV.SelectedIndex = 4 Or cboAtcrJV.SelectedIndex = 5 Or cboAtcrJV.SelectedIndex = 6 Or cboAtcrJV.SelectedIndex = 8 Or cboAtcrJV.SelectedIndex = 9 Or cboAtcrJV.SelectedIndex = 10 Or cboAtcrJV.SelectedIndex = 11 Or cboAtcrJV.SelectedIndex = 12 Or cboAtcrJV.SelectedIndex = 13) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If If (cboATdrJV.SelectedIndex = 4 Or cboATdrJV.SelectedIndex = 5 Or cboATdrJV.SelectedIndex = 7 Or cboATdrJV.SelectedIndex = 2 Or cboATdrJV.SelectedIndex = 3 Or cboATdrJV.SelectedIndex = 6 Or cboATdrJV.SelectedIndex = 8 Or cboATdrJV.SelectedIndex = 9 Or cboATdrJV.SelectedIndex = 10 Or cboATdrJV.SelectedIndex = 11 Or cboATdrJV.SelectedIndex = 12 Or cboATdrJV.SelectedIndex = 13) And (cboAtcrJV.SelectedIndex = 1 Or cboAtcrJV.SelectedIndex = 2 Or cboAtcrJV.SelectedIndex = 3 Or cboAtcrJV.SelectedIndex = 6 Or cboAtcrJV.SelectedIndex = 8 Or cboAtcrJV.SelectedIndex = 9 Or cboAtcrJV.SelectedIndex = 10 Or cboAtcrJV.SelectedIndex = 11 Or cboAtcrJV.SelectedIndex = 12 Or cboAtcrJV.SelectedIndex = 13) Then MsgBox("Error" + vbCr + "Combination not allowed!", MsgBoxStyle.Exclamation, "GJ") cboAtcrJV.Text = Nothing cboATdrJV.Text = Nothing Exit Sub End If txtDateJV.Text = DateTimePicker3.Text lblDateJV.Text = txtDateJV.Text lblATcrJV.Text = cboAtcrJV.Text lblATdrJV.Text = cboATdrJV.Text lblAmtcrJV.Text = txtAmtcrJV.Text lblAmtdrJV.Text = txtAmtdrJV.Text ' btnClearJV.PerformClick() 'Panel15.Enabled = False btnPrintJV.Enabled = True btnPreviewJV.Enabled = True btnDoneJV.Enabled = True btnExitJV.Enabled = True btnAddJV.Enabled = True End Sub Private Sub btnExitJV_Click(sender As Object, e As EventArgs) Handles btnExitJV.Click lblDateJV.Text = "-" lblATcrJV.Text = "-" lblATdrJV.Text = "-" lblAmtcrJV.Text = "-" lblAmtdrJV.Text = "-" btnClearJV.PerformClick() btnPrintJV.Enabled = False btnPreviewJV.Enabled = False btnDoneJV.Enabled = False btnAddJV.Enabled = True Panel13.Enabled = False Panel14.Enabled = False Panel15.Enabled = True txtDateJV.Focus() End Sub Private Sub btnDoneJV_Click(sender As Object, e As EventArgs) Handles btnDoneJV.Click ' lblJVnum.Text = lblJVnum.Text + 1 OpenDBConnection3() With dbAdapter3 .InsertCommand = dbConn3.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_GJ,Particulars,Debit) VALUES('" & txtDateJV.Text.Trim & "','" & lblATdrJV.Text & "','" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() .InsertCommand.CommandText = "INSERT INTO Table1 (Particulars,Credit) VALUES('" & " " & lblATcrJV.Text & "','" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection3() If cboATdrJV.Text = "Cash" Then OpenDBConnection5() With dbAdapter5 .InsertCommand = dbConn5.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection5() End If If cboAtcrJV.SelectedIndex = 1 Then OpenDBConnection6() With dbAdapter6 .InsertCommand = dbConn6.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection6() End If If cboAtcrJV.SelectedIndex = 5 Then OpenDBConnection10() With dbAdapter10 .InsertCommand = dbConn10.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection10() End If If cboAtcrJV.SelectedIndex = 7 Then OpenDBConnection12() With dbAdapter12 .InsertCommand = dbConn12.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection12() End If '-------------------------------------------------------------------------------------------------------------------------- If cboAtcrJV.Text = "Cash" Then OpenDBConnection5() With dbAdapter5 .InsertCommand = dbConn5.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection5() End If If cboATdrJV.SelectedIndex = 2 Then OpenDBConnection7() With dbAdapter7 .InsertCommand = dbConn7.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection7() End If If cboATdrJV.SelectedIndex = 3 Then OpenDBConnection8() With dbAdapter8 .InsertCommand = dbConn8.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection8() End If If cboATdrJV.SelectedIndex = 4 Then OpenDBConnection9() With dbAdapter9 .InsertCommand = dbConn9.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection9() End If If cboATdrJV.SelectedIndex = 6 Then OpenDBConnection11() With dbAdapter11 .InsertCommand = dbConn11.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection11() End If If cboATdrJV.SelectedIndex = 8 Then OpenDBConnection13() With dbAdapter13 .InsertCommand = dbConn13.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection13() End If If cboATdrJV.SelectedIndex = 9 Then OpenDBConnection14() With dbAdapter14 .InsertCommand = dbConn14.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection14() End If If cboATdrJV.SelectedIndex = 10 Then OpenDBConnection15() With dbAdapter15 .InsertCommand = dbConn15.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection15() End If If cboATdrJV.SelectedIndex = 11 Then OpenDBConnection16() With dbAdapter16 .InsertCommand = dbConn16.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection16() End If If cboATdrJV.SelectedIndex = 12 Then OpenDBConnection17() With dbAdapter17 .InsertCommand = dbConn17.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection17() End If If cboATdrJV.SelectedIndex = 13 Then OpenDBConnection18() With dbAdapter18 .InsertCommand = dbConn18.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection18() End If If cboATdrJV.SelectedIndex = 1 Then OpenDBConnection6() With dbAdapter6 .InsertCommand = dbConn6.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Dr,Debit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtdrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection6() End If If cboAtcrJV.SelectedIndex = 4 Then OpenDBConnection9() With dbAdapter9 .InsertCommand = dbConn9.CreateCommand .InsertCommand.CommandText = "INSERT INTO Table1 (Date_Cr,Credit) VALUES( '" & txtDateJV.Text.Trim & "', '" & Val(txtAmtcrJV.Text) & "');" .InsertCommand.ExecuteNonQuery() End With CloseDBConnection9() End If lblJVnum.Text = lblJVnum.Text + 1 btnExitJV.PerformClick() End Sub Private Sub btnPrintJnal_Click(sender As Object, e As EventArgs) Handles btnPrintJnal.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 1293, 650) prn.DefaultPageSettings = pageSettings CaptureScreen4() PrintDocument4.DefaultPageSettings = pageSettings PrintDocument4.DefaultPageSettings.Landscape = True PrintDocument4.Print() ' Dim prn As New Printing.PrintDocument ' Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings ' pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) 'prn.DefaultPageSettings = pageSettings ' PrintDialog1.Document = PrintDocument1 ' PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings ' PrintDialog1.AllowSomePages = True ' If PrintDialog1.ShowDialog = DialogResult.OK Then 'PrintDocument1.DefaultPageSettings = pageSettings ' CaptureScreen() 'PrintDocument1.Print() 'End If End Sub Private Sub btnPreviewJnal_Click(sender As Object, e As EventArgs) Handles btnPreviewJnal.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 1293, 650) prn.DefaultPageSettings = pageSettings CaptureScreen4() Dim i, count As Integer count = 5 For i = 1 To count 'Me.PrintPreviewDialog1.Add(Me.PrintDocument1) Next Me.PrintPreviewDialog4.Document = Me.PrintDocument4 PrintDocument4.DefaultPageSettings.Landscape = True PrintDocument4.DefaultPageSettings = pageSettings Me.PrintPreviewDialog4.ShowDialog() End Sub Private Sub PrintDocument4_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument4.PrintPage CaptureScreen4() e.Graphics.DrawImage(memoryImage4, 0, 0) End Sub Private Sub btnRefresh_Click(sender As Object, e As EventArgs) Handles btnRefresh.Click UpdateCDJ() UpdateCRJ() UpdateGJ() UpdateTApg1() UpdateTApg2() UpdateTApg3() UpdateTApg4() UpdateTB() UpdateIS() UpdateBS() End Sub Private Sub UpdateCDJ() LoadAccountData("SELECT Date_CDJ,CV_No,Check_No,Payor,Cash,Acct_R,Supplies,Equipment,Acct_P,Capital,Drawing,Fees,Wages_Exp,Ads_Exp,Rent_Exp,Tel_Exp,Electricity_Exp,Misc_Exp FROM Table1;") 'LoadAccountData2("SELECT sum(Cash) as Credit,sum(Equipment) as Debit FROM Table1;") 'OpenDBConnection() 'With dbAdapter ' .SelectCommand = dbConn.CreateCommand ' .SelectCommand.CommandText = "SELECT Cash,sum(Cash) as Total FROM Table1 GROUP BY Cash;" ' .SelectCommand.ExecuteReader() 'End With 'CloseDBConnection() 'dbDataSet = New DataSet("DataSet_Accounts") 'dbAdapter.Fill(dbDataSet, "DataSet_Accounts") Dim total As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total += DataGridView1.Item(4, i).Value Next lblsumCashCDJ.Text = total.ToString Dim total2 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total2 += DataGridView1.Item(5, i).Value Next lblsumARcdj.Text = total2.ToString Dim total3 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total3 += DataGridView1.Item(6, i).Value Next lblsumSupCDJ.Text = total3.ToString Dim total4 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total4 += DataGridView1.Item(7, i).Value Next lblsumEqpCDJ.Text = total4.ToString Dim total5 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total5 += DataGridView1.Item(8, i).Value Next lblsumAPCDJ.Text = total5.ToString Dim total6 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total6 += DataGridView1.Item(9, i).Value Next lblsumCapCDJ.Text = total6.ToString Dim total7 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total7 += DataGridView1.Item(10, i).Value Next lblsumDrwCDJ.Text = total7.ToString Dim total8 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total8 += DataGridView1.Item(11, i).Value Next lblsumFeeCDJ.Text = total8.ToString Dim total9 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total9 += DataGridView1.Item(12, i).Value Next lblsumWgCDJ.Text = total9.ToString Dim total10 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total10 += DataGridView1.Item(13, i).Value Next lblsumADsCDJ.Text = total10.ToString Dim total11 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total11 += DataGridView1.Item(14, i).Value Next lblsumRntExpCDJ.Text = total11.ToString Dim total12 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total12 += DataGridView1.Item(15, i).Value Next lblsumTelExpCDJ.Text = total12.ToString Dim total13 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total13 += DataGridView1.Item(16, i).Value Next lblsumElecExpCDJ.Text = total13.ToString Dim total14 As Integer For i As Integer = 0 To DataGridView1.RowCount() - 1 total14 += DataGridView1.Item(17, i).Value Next lblsumMiscCDJ.Text = total14.ToString End Sub Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click If MsgBox("Warning!" + vbCr + "This action will clear all your records." + vbCr + "Do you want to continue?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo, "Confirm") = MsgBoxResult.Yes Then ResetCDJ() ResetCRJ() ResetGJ() ResetTApg1() ResetTApg2() ResetTApg3() ResetTApg4() ResetTB() ResetIS() ResetBS() UpdateCDJ() UpdateCRJ() UpdateGJ() UpdateTApg1() UpdateTApg2() UpdateTApg3() UpdateTApg4() UpdateTB() UpdateIS() UpdateBS() End If End Sub Private Sub ResetCDJ() OpenDBConnection() With dbAdapter .DeleteCommand = dbConn.CreateCommand .DeleteCommand.CommandText = "DELETE * FROM Table1;" .DeleteCommand.ExecuteNonQuery() End With CloseDBConnection() LoadAccountData("SELECT Date_CDJ,CV_No,Check_No,Payor,Cash,Acct_R,Supplies,Equipment,Acct_P,Capital,Drawing,Fees,Wages_Exp,Ads_Exp,Rent_Exp,Tel_Exp,Electricity_Exp,Misc_Exp FROM Table1;") btnRefresh.PerformClick() End Sub Private Sub btnPreviewCRJ_Click(sender As Object, e As EventArgs) Handles btnPreviewCRJ.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 1295, 650) prn.DefaultPageSettings = pageSettings CaptureScreen5() Dim i, count As Integer count = 5 For i = 1 To count 'Me.PrintPreviewDialog1.Add(Me.PrintDocument1) Next Me.PrintPreviewDialog5.Document = Me.PrintDocument5 PrintDocument5.DefaultPageSettings.Landscape = True PrintDocument5.DefaultPageSettings = pageSettings Me.PrintPreviewDialog5.ShowDialog() End Sub Private Sub btnPrintCRJ_Click(sender As Object, e As EventArgs) Handles btnPrintCRJ.Click Dim prn As New Printing.PrintDocument Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 1258, 650) prn.DefaultPageSettings = pageSettings CaptureScreen5() PrintDocument5.DefaultPageSettings = pageSettings PrintDocument5.DefaultPageSettings.Landscape = True PrintDocument5.Print() ' Dim prn As New Printing.PrintDocument ' Dim pageSettings As System.Drawing.Printing.PageSettings = New System.Drawing.Printing.PageSettings ' pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Bill", 989, 452) 'prn.DefaultPageSettings = pageSettings ' PrintDialog1.Document = PrintDocument1 ' PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings ' PrintDialog1.AllowSomePages = True ' If PrintDialog1.ShowDialog = DialogResult.OK Then 'PrintDocument1.DefaultPageSettings = pageSettings ' CaptureScreen() 'PrintDocument1.Print() 'End If End Sub Private Sub PrintDocument5_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument5.PrintPage CaptureScreen5() e.Graphics.DrawImage(memoryImage5, 0, 0) End Sub Private Sub btnRefreshCRJ_Click(sender As Object, e As EventArgs) Handles btnRefreshCRJ.Click UpdateCDJ() UpdateCRJ() UpdateGJ() Update