none
Linking combo and text boxes together and displaying total data in a list box RRS feed

  • Question

  • For a school assignment I have to create this program. Having trouble finding any help online with this code. Attached is what my program looks like. I have a Microsoft assess database attached to the program. The combo boxes under the product selection have all been linked to 'product' under ProductDB. How ever I want the user to manually input a value to say how much of the product [has been sold] in the textbox corresponding to the right of the combo box and then when the enter button is clicked on the keyboard I need the total AUD, CV, Bonus & PTS calculated from the amount of all the different products selected and the totals displayed in the list box. I haven't found anything online probably because I don't quite know what to type into google and my teacher has giving us no resources but an archaic book they don't even know how to code themselves. I've also attached a screen shot of the database. 

    ~ Thanks

    htt ps ://past eboard .co/GFZh ata.p ng <-- Program

    htt ps ://past eboard .co/GFZh AuW.p ng <-- Access Database

    Wednesday, August 16, 2017 11:55 PM

All replies

  • The combo boxes under the product selection have all been linked to 'product' under ProductDB. How ever I want the user to manually input a value to say how much of the product [has been sold] in the textbox corresponding to the right of the combo box and then when the enter button is clicked on the keyboard I need the total AUD, CV, Bonus & PTS calculated from the amount of all the different products selected and the totals displayed in the list box. I haven't found anything online probably because I don't quite know what to type into google and my teacher has giving us no resources but an archaic book they don't even know how to code themselves. I've also attached a screen shot of the database. 

    ~ Thanks

    htt ps ://past eboard .co/GFZh ata.p ng <-- Program

    htt ps ://past eboard .co/GFZh AuW.p ng <-- Access Database

    Hi NeonSukai,

    According to your description, you want to get all product data from Access database and display these in combobox? But you also use Textbox,do you also have some issue here?

    Here is the example that display data from Access database.

        Dim ds As New DataSet
        Private Sub Form10_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          
            fun()
            ComboBox1.DataSource = ds.Tables(0).DefaultView
            ComboBox1.DisplayMember = "Table"
            ComboBox1.ValueMember = "ProductName"
    
        End Sub
    Private Sub fun()
            Dim str As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Database\Test2.accdb;Persist Security Info=False;"
            Dim conn As New OleDbConnection(str)
            Dim sql As String = "Select ProductName from Test0"
            Using cmd As New OleDbCommand(sql, conn)
                Dim adapter As New OleDbDataAdapter(cmd)
                adapter.Fill(ds)
            End Using
        End Sub

    By the way, I get nothing from the link you provide.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, August 17, 2017 8:16 AM
    Moderator