实际上,我有一个Access数据库,其中有一个名为"tblfreight“的表,其中有两列(items和Price)。
当我选择商品时,我想自动显示价格。
有两个文本框:"txtitems“和"txtprice”
我想成为这样的人...
If txtitems.text = select from tblfreight and column items Then
txtprice.text = select from tblfreight and column Price
Else txtprice.text=0 (Zero)
发布于 2013-02-09 14:34:26
您需要先查询您的数据库。
Select * from tblfreight将为您提供所需的数据。
然后,您需要将这些数据放在某个地方。为此,您可以使用组合框。一旦你用你的数据填充了你的组合框,你就可以很容易地在标签或文本框中设定价格。
您可以使用combobox selected index changed事件...
在changed事件中,像这样的东西可以工作……
textprice.text = Combobox.selecteditem.value
这将给你一个很好的开始,这就是为什么这个答案只给你步骤,而不是完整的代码。
https://stackoverflow.com/questions/14788027
复制相似问题