|
应该不难吧?帮你看看.
你的子窗体为何不与明细表绑定呢?似乎绑定了比较好吧,免得还要加保存记录按钮.
Private Sub Command31_Click()
Dim sql1, sql2 As String
DoCmd.SetWarnings no
If Not (IsNull(Me.单据号)) Then
sql1 = "INSERT INTO 入库单 ( 单据号, 入库日期, 拨货单据号, 制单人, 审核人, 状态, 备注 ) "
sql1 = sql1 + "SELECT Forms!入库单!单据号 AS 单据号, Forms!入库单!入库日期 AS 入库日期, Forms!入库单!拨货单据号 AS 拨货单据号, Forms!入库单!制单人 AS 制单人, Forms!入库单!审核人 AS 审核人, Forms!入库单!状态 AS 状态, Forms!入库单!备注 AS 备注;"
DoCmd.RunSQL sql1
sql2 = "INSERT INTO 入库明细 ( 单据号, 制单人, 审核人, 状态, 备注 ) "
sql2 = sql2 + "SELECT Forms!入库单!单据号 AS 单据号, Forms!入库单!制单人 AS 制单人, Forms!入库单!审核人 AS 审核人, Forms!入库单!状态 AS 状态, Forms!入库单!备注 AS 备注;"
DoCmd.RunSQL sql2
Me.入库明细.Form.Requery
End If
End Sub
[ 本帖最后由 todaynew 于 2009-1-10 14:24 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|