|
如果要加上判断有没有选择记录.,也不用像你这么复杂,只要
- Private Sub Command8_Click()
- Dim sSQL As String
- Dim L As Long
- L = DCount("ORDER_QTY", "tab_COtoPACKINGLIST", "aa_status=True")
- If L <= 0 Then
- MsgBox "还没有选择记录,不能添加"
- Exit Sub
- End If
- sSQL = "INSERT INTO tab_SANWA_PACKINGLIST_TPRY ( PO_NO, SANWA_ITEM, ITEM_DESC, ORDER_QTY, SHIP_DATE )" _
- & " SELECT tab_COtoPACKINGLIST.PO_NO, tab_COtoPACKINGLIST.SANWA_ITEM, tab_COtoPACKINGLIST.ITEM_DESC, tab_COtoPACKINGLIST.ORDER_QTY, tab_COtoPACKINGLIST.SHIP_DATE" _
- & " FROM tab_COtoPACKINGLIST" _
- & " WHERE (((tab_COtoPACKINGLIST.aa_status)=True))"
- CurrentDb.Execute sSQL
- sSQL = "DELETE FROM tab_COtoPACKINGLIST WHERE (((tab_COtoPACKINGLIST.aa_status)=True))"
- CurrentDb.Execute sSQL
- Me.tab_COtoPACKINGLIST_subform.Requery
- Me.tab_SANWA_PACKINGLIST_TPRY_subform.Requery
- End Sub
复制代码 |
评分
-
查看全部评分
|