I have created a DataBase in Sequel Server Management Studio called Budget 2007. I have setup formats as:
StateCheck#1 Money
StateCheck#2 Money
Other Income1 Money
Other Income2 Money
Other Income3 Money
SSN Nchar(10)
I have created other formats for expense, whihc I have not indicated here, but are all Money Fields.
Please find VB Program below. This program runs but does not save or update anything to the Sequel Server each time I enter data in. What am I doing wrong? Data Entered in should save back to the Sequael Server Each time and allow updates, Deletes, and Changes too which I am not able to do. I can go directly into the Sequel Server management Studio and add records and they will come up when I go into Virtual Studio and pull up the Budget2007 Project.
Public Class frmMonthlyBudget
Private Sub IncomeBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IncomeBindingNavigatorSaveItem.Click
Me.Validate()
Me.IncomeBindingSource.EndEdit()
Me.IncomeTableAdapter.Update(Me.Budget2007DataSet.Income)
End Sub
Private Sub frmMonthlyBudget_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Budget2007DataSet.Expense' table. You can move, or remove it, as needed.
Me.ExpenseTableAdapter.Fill(Me.Budget2007DataSet.Expense)
'TODO: This line of code loads data into the 'Budget2007DataSet.Income' table. You can move, or remove it, as needed.
Me.IncomeTableAdapter.Fill(Me.Budget2007DataSet.Income)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'This code computes Total Income for the Month'
txtTotalIncome.Text = CType(txtStateCheck1.Text, Double) + CType(txtStateCheck2.Text, Double) _
+ CType(txtOtherIncome1.Text, Double) + CType(txtOtherIncome2.Text, Double) _
+ CType(txtOtherIncome3.Text, Double)
'This code computes Total Expense for the Month'
txtTotalExpense.Text = CType(txtMortgage1.Text, Double) + CType(txtMortgage2.Text, Double) _
+ CType(txtWellsFargo1.Text, Double) + CType(txtWellsFargo2.Text, Double) + CType(txtGroceries.Text, Double) _
+ CType(txtMBNA.Text, Double) + CType(txtWaterBill.Text, Double) + CType(txtGasforCars.Text, Double) + _
CType(txtAlagasco.Text, Double) + CType(txtJuniper.Text, Double) + CType(txtElectricity.Text, Double) _
+ CType(txtCable.Text, Double) + CType(txtStateFarm.Text, Double) + CType(txtAlfa1.Text, Double) _
+ CType(txtAlfa2.Text, Double) + CType(txtOther1.Text, Double) + CType(txtOther2.Text, Double) _
+ CType(txtOther3.Text, Double) + CType(txtOther4.Text, Double) + CType(txtOther5.Text, Double)
'This Code Assigns Original Total Income to Another Field to be used in calculations'
txtTotalIncome1.Text = txtTotalIncome.Text
'This Code Assigns Original Total Expense to Another Field to be used in Calculationns'
txtTotalExpense1.Text = txtTotalExpense.Text
'This Code Computes the Total Balance Remaining in your Budget'
txtBalance.Text = txtTotalIncome1.Text - txtTotalExpense1.Text
'This Code Checks Whether you have exceeded your budget and gives Message'
If txtBalance.Text <= 0 Then
MessageBox.Show("You Have Exceeded Your Budget for the Month.", "BUDGET EXCEEDED")
MessageBox.Show("Please Review Your Figures and Try Again......", "TRY AGAIN PLEASE")
End If
End Sub
End Class
StateCheck#1 Money
StateCheck#2 Money
Other Income1 Money
Other Income2 Money
Other Income3 Money
SSN Nchar(10)
I have created other formats for expense, whihc I have not indicated here, but are all Money Fields.
Please find VB Program below. This program runs but does not save or update anything to the Sequel Server each time I enter data in. What am I doing wrong? Data Entered in should save back to the Sequael Server Each time and allow updates, Deletes, and Changes too which I am not able to do. I can go directly into the Sequel Server management Studio and add records and they will come up when I go into Virtual Studio and pull up the Budget2007 Project.
Public Class frmMonthlyBudget
Private Sub IncomeBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IncomeBindingNavigatorSaveItem.Click
Me.Validate()
Me.IncomeBindingSource.EndEdit()
Me.IncomeTableAdapter.Update(Me.Budget2007DataSet.Income)
End Sub
Private Sub frmMonthlyBudget_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Budget2007DataSet.Expense' table. You can move, or remove it, as needed.
Me.ExpenseTableAdapter.Fill(Me.Budget2007DataSet.Expense)
'TODO: This line of code loads data into the 'Budget2007DataSet.Income' table. You can move, or remove it, as needed.
Me.IncomeTableAdapter.Fill(Me.Budget2007DataSet.Income)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'This code computes Total Income for the Month'
txtTotalIncome.Text = CType(txtStateCheck1.Text, Double) + CType(txtStateCheck2.Text, Double) _
+ CType(txtOtherIncome1.Text, Double) + CType(txtOtherIncome2.Text, Double) _
+ CType(txtOtherIncome3.Text, Double)
'This code computes Total Expense for the Month'
txtTotalExpense.Text = CType(txtMortgage1.Text, Double) + CType(txtMortgage2.Text, Double) _
+ CType(txtWellsFargo1.Text, Double) + CType(txtWellsFargo2.Text, Double) + CType(txtGroceries.Text, Double) _
+ CType(txtMBNA.Text, Double) + CType(txtWaterBill.Text, Double) + CType(txtGasforCars.Text, Double) + _
CType(txtAlagasco.Text, Double) + CType(txtJuniper.Text, Double) + CType(txtElectricity.Text, Double) _
+ CType(txtCable.Text, Double) + CType(txtStateFarm.Text, Double) + CType(txtAlfa1.Text, Double) _
+ CType(txtAlfa2.Text, Double) + CType(txtOther1.Text, Double) + CType(txtOther2.Text, Double) _
+ CType(txtOther3.Text, Double) + CType(txtOther4.Text, Double) + CType(txtOther5.Text, Double)
'This Code Assigns Original Total Income to Another Field to be used in calculations'
txtTotalIncome1.Text = txtTotalIncome.Text
'This Code Assigns Original Total Expense to Another Field to be used in Calculationns'
txtTotalExpense1.Text = txtTotalExpense.Text
'This Code Computes the Total Balance Remaining in your Budget'
txtBalance.Text = txtTotalIncome1.Text - txtTotalExpense1.Text
'This Code Checks Whether you have exceeded your budget and gives Message'
If txtBalance.Text <= 0 Then
MessageBox.Show("You Have Exceeded Your Budget for the Month.", "BUDGET EXCEEDED")
MessageBox.Show("Please Review Your Figures and Try Again......", "TRY AGAIN PLEASE")
End If
End Sub
End Class