Private Sub ID_AfterUpdate()
'每次产品更改的初始价格和折扣
If Not IsNull(Me![ID]) Then
Me![列出价格] = GetListPrice(Me![ID])
Me![标准成本] = GetStandardCost(Me![ID])
'空产品订单表示用户要删除项目
Else
eh.TryToRunCommand acCmdDeleteRecord
End If
End Sub
Function GetStandardCost(lID As String) As Currency
GetStandardCost = DLookup("[标准成本]", "报价扩展", "[ID] = '" & Forms!orders1!ID "'" And "[customer] ='" & Forms!orders1!customer"'")
End Function
Function GetListPrice(lID As String) As Currency
GetListPrice = DLookup("[列出价格]", "报价扩展", "ID= '" & Forms!orders1!ID "'" And "[customer] = '" & Forms!orders1!customer"'")
End Function 作者: Henry D. Sy 时间: 2017-3-10 13:44
try
Function GetStandardCost(lID As String) As Currency