Jacksparrow87
Technical User
Hi people, I was hoping someone could offer me some help please, I have my application all working apart from this one problem im facing with.
What the program does is simple, my combobox consists of company names, and when a company name is selected their calls logged are shown in a label. What I need help with is the ‘Save’ button, what I want to do is when the save button is selected I want to +1 to the value in the label and save the new number in the database.
So far I have the following coding which shows the data:
Any help would be appreciated.
Thanks
What the program does is simple, my combobox consists of company names, and when a company name is selected their calls logged are shown in a label. What I need help with is the ‘Save’ button, what I want to do is when the save button is selected I want to +1 to the value in the label and save the new number in the database.
So far I have the following coding which shows the data:
Code:
Dim constr As String = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Application.StartupPath & "\CNS.mdb"
Dim tblComp As New DataTable
Dim connection As New OleDbConnection(constr)
Private Sub Loadcus()
Dim adapter As New OleDbDataAdapter("SELECT * FROM [Company] ORDER BY CompanyName", connection)
tblComp.Clear()
adapter.Fill(tblComp)
Me.cmbcomp.DisplayMember = "CompanyName"
Me.cmbcomp.ValueMember = "CompID"
Me.cmbcomp.DataSource = tblComp
Me.lblclog.DataBindings.Add("Text", tblComp, "CallsLogged")
End Sub
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Loadcus()
End Sub
Any help would be appreciated.
Thanks