Private Sub cmdlabel1_Click()
Dim isok As Integer
isok = MsgBox("关闭前,要仔细核对哦", vbYesNo, SoftName)
If isok = vbYes Then
Me.出库单编号.SetFocus
Else
DoCmd.Close
End If
End Sub(这种关闭的是整个数据库,怎么让它只关闭该窗口,又有提示呢?)
Private Sub cmdlabel1_Click()
On Error GoTo Err_cmdlabel1_Click
DoCmd.Close
Exit_cmdlabel1_Click:
Exit Sub
Err_cmdlabel1_Click:
MsgBox Err.Description
Resume Exit_cmdlabel1_Click
End Sub(这个关闭的是窗口)
我试过是关闭的本窗口,不是整个数据库啊,你可以试试这个:
Dim isok As Integer
isok = MsgBox("关闭前,要仔细核对哦", vbYesNo, SoftName)
If isok = vbYes Then
Me.出库单编号.SetFocus
Else
DoCmd.Close acForm, Me.Name
End If