Private Sub 数量_AfterUpdate()
Me.金额 = Me.出库单价 * Me.数量
Dim intsl As Single
Dim strpm As String
strpm = Me.货号
intsl = DLookup("数量", "库存表", "货号='" & strpm & "'")
If Me.数量 > intsl Then
MsgBox "当前库存不够出库,请变更数量后再确定保存!", , "取消出库!"
Me.Undo
Exit Sub
End If
End Sub[attach]16327[/attach]