下面是保存按钮的代码:
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