将组合框和文本框链接在一起,并在列表框中显示总数据 [英] Linking combo and text boxes together and displaying total data in a list box

查看:81
本文介绍了将组合框和文本框链接在一起,并在列表框中显示总数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于学校作业,我必须创建这个程序。无法使用此代码在线查找任何帮助。附件是我的程序的样子。我有一个附加到该程序的Microsoft评估数据库。产品选择
下的组合框全部链接到ProductDB下的"product"。我怎么希望用户手动输入一个值来说明在组合框右侧对应的文本框中有多少[已售出]产品,然后在
键盘上单击输入按钮时需要总AUD,CV,Bonus& PTS根据所选的所有不同产品的数量和列表框中显示的总数计算得出。我没有在网上找到任何东西,可能是因为我不太清楚要输入谷歌和
我的老师给了我们没有资源但是他们甚至不知道如何自己编码的古老书籍。我还附上了数据库的屏幕截图。 

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. 

〜谢谢

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

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

htt ps://过去eboard .co / GFZh AuW.p ng< - Access数据库

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

推荐答案


产品选择下的组合框全部链接到ProductDB下的"product"。我希望用户手动输入一个值来说明在组合框右侧对应的文本框中有多少产品[已售出],然后在键盘上单击输入按钮时为
需要总AUD,CV,Bonus& PTS根据所选的所有不同产品的数量和列表框中显示的总数计算得出。我在网上找不到任何东西,可能是因为我不知道要输入谷歌的内容,我的老师给了我们没有资源,但是他们甚至不知道如何自己编码的古老书籍。我还附上了数据库的屏幕截图。 

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. 

〜谢谢

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

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

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

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

您好NeonSukai,

Hi NeonSukai,

根据您的描述,您想从Access数据库获取所有产品数据并在组合框中显示这些数据?但你也使用Textbox,你在这里也遇到了一些问题吗?

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?

这是从Access数据库显示数据的例子。

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.

最好的问候,

Cherry


这篇关于将组合框和文本框链接在一起,并在列表框中显示总数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆