訂單表單的AfterUpdate事件新增程式碼,請依需求自行修改
Private Sub Form_AfterUpdate()
DoCmd.RunSQL "insert into 半成品需求表(訂單號碼, 半成品料號,半成品需求量) " & _
"select A.訂單號碼, B.半成品料號, B.半成品使用量*A.訂單數量 " & _
" from 訂單成品表 as A left join Bom表 as B on A.成品料號=B.成品料號 " & _
"where A.訂單號碼 = '" & Me.訂單號碼 & "'"
End Sub