【发布时间】:2013-08-24 21:36:11
【问题描述】:
我正在尝试在 access 2010 中构建一个类似 Northwind 风格的排序系统,但稍微不那么复杂!当从组合框中选择产品时,我需要将产品的价格从库存中带到订单详细信息子表单中,因此作为新手,我的代码无法正常工作...
Private Sub Product_AfterUpdate()
Dim PriceX As Currency, UnitX As Currency
PriceX = DLookup("Unit Price", "ProductInventory", "[ProductInventory].[Product]=" & [Product].Value)
UnitX = DLookup("Unit", "ProductInventory", "[Product] =" & [Product].Value)
Unit_Price.Value = PriceX
Unit.Value = UnitX
End Sub
【问题讨论】:
-
以后请详细说明错误信息。我们不像@HansUp那么聪明!
-
当发布的答案解决了我的问题时,很容易变得慷慨。祝你 2016 年快乐。
标签: ms-access vba ms-access-2010