|
我在半成品入库窗体中,输入的半成品工艺编号在半成品入库库存查询中,并且它的库存=0的情况下才允许入库。
Function m_zhuijia()
If MsgBox("[" & Forms![半成品入库]![入库半成品工艺编号] & "] 此半成品要入库吗?", vbYesNo + vbInformation, "半成品入库") = vbYes Then
If IsNull(Forms![半成品入库]![入库半成品工艺编号]) Then
Beep
MsgBox "请输入产品工艺编号.", vbOKOnly + vbExclamation存
Forms![半成品入库]![入库半成品工艺编号].SetFocus
Exit Function
End If
If IsNull(DLookup("[入库半成品工艺]", "半成品入库库存查询", " [入库半成品工艺编号]=" & Forms![半成品入库]![入库半成品工艺编号] "And [库存数]=0"")) Then
MsgBox " 此道工艺产品在半成品库存中还有库存,请先出库后合并再入库"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRecordsGoToNew
Else
MsgBox "此产品"
Exit Function
End If
End If
End Function
If IsNull(DLookup("[入库半成品工艺]", "半成品入库库存查询", " [入库半成品工艺编号]=" & Forms![半成品入库]![入库半成品工艺编号] "And [库存数]=0"")) Then |
|