Private Sub 项次_AfterUpdate()
Dim DB As Database
Dim RST, RST0 As Recordset
If IsNull([生产单号]) Then
MsgBox "请先输入 生产单号", vbInformation
[生产单号].SetFocus
Exit Sub
Else
Set DB = CurrentDb
Set RST = DB.OpenRecordset("Order", dbOpenSnapshot)
Set RST0 = DB.OpenRecordset("tblshipment A", dbOpenSnapshot)
'先查 出貨資料,再查 Porder
'出貨資料有資料,找出最後一筆
'無,則查 Porder 資料
RST0.FindFirst "[生产单号]='" & Me![生产单号] & "' and [项次]=" & Me![项次]
If RST0.NoMatch Then