Office中国论坛/Access中国论坛

标题: 请帮忙看一下 [打印本页]

作者: uranusllj    时间: 2003-5-28 00:07
标题: 请帮忙看一下
[attach]564[/attach]
如图所示,在保存时会弹出这个,子窗体中的记录只能保存一条,此时如果点“确定”,然后再接着点保存,记录会继续保存下去,完成循环。

下面是保存按钮的代码:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim respone
If Me.list列表21.RowSource = "" Then
    respone = MsgBox("你还没有输入要出库的工装编号,现在要输入吗?", 4, Me.Caption)
    If respone = vbYes Then
        Me.txt工装编号.SetFocus
        GoTo Exit_cmdSave_Click
    Else
        GoTo Exit_cmdSave_Click
    End If
End If
Dim i As Long
Dim strtmp As Variant
For i = 0 To Me.list列表21.ListCount - 1
    strtmp = Me.list列表21.ItemData(i)
    Me.子对象14.SetFocus
    Me.子对象14.Form.ckmx_工装编号 = Me.ckd_工装类型 & Me.zh生产日期 & strtmp
    Me.子对象14.Form.ckmx_凭证编号 = Me.ckd_凭证编号
    Me.子对象14.Form.ckmx_状态 = Me.ckd_凭证类型
    DoCmd.RunCommand acCmdRecordsGoToNext
Next i

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.list列表21.RowSource = ""
Me.txt工装编号 = ""
Me.cmdPrev.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdNew.Enabled = True
Me.cmdNew.SetFocus
Me.cmdSave.Enabled = False
Me.cmdGiveup.Enabled = False
Me.cmdDel.Enabled = True
Me.cmdListAdd.Enabled = False
Me.cmdListDel.Enabled = False
Me.cmdOpenfrm.Enabled = True
Me.cmdQuit.Enabled = True
Me.AllowEdits = False

Exit_cmdSave_Click:
    Exit Sub

Err_cmdSave_Click:
    MsgBox Err.Description
    Resume Exit_cmdSave_Click
   
End Sub
请帮帮忙!

作者: uranusllj    时间: 2003-5-28 00:17
已经解决了!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3