|
请老师看看我的写的代码为什么不能及时提示,库存量低于安全库存,跳出提示框为什么不能每次查找原料号码时候跳出提示,而是在更换了其他原料号码时候才跳出呢?
Private Sub Combo2_AfterUpdate()
if me.onhand_qty<= me.safty_qty then
msgbox"库存量已经低于安全库存,请及时采购"
end if
If DCount("*", "tblProduct_Stock_Remote", "Item='" & Combo2 & "'") = 0 Then
MsgBox strName & " 物料号不存在!"
Me.Combo2.SetFocus
End If
Me.ITEM.Value = DLookup("[ITEM]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.item_desc.Value = DLookup("[ITEM_DESC]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Real_Qty.Value = DLookup("[Real_Qty]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Available_Qty.Value = DLookup("[Available_Qty]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Safe_qty.Value = DLookup("[Saft_Qty]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Unit.Value = DLookup("[Unit]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Unit_Price.Value = DLookup("[Unit_Price]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
' Me.Combo4.RowSource = DLookup("[ITEM_DESC]", "[tblProduct_Stock_Remote]", "[ITEM]='" & Me.Combo2 & "'") '1
Me.Total_Values.Value = Me.Unit_Price * Me.Real_Qty
Me.Requery
Me.Recalc
我把这个代码放到了
|
|