access關閉窗體的vba代碼怎么寫?
1)如用cmdClose按鈕關閉當前窗體:
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
2)如關閉其他打開的窗體:
Private Sub cmdClose_Click()
DoCmd.Close acForm, "窗體名", acSaveYes
'參數:acSaveYes=保存;acSaveNo=不保存;acSavePrompt=提示
End Sub
上一篇聯想電腦軟驅怎么關
access關閉窗體的vba代碼怎么寫?
1)如用cmdClose按鈕關閉當前窗體:
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
2)如關閉其他打開的窗體:
Private Sub cmdClose_Click()
DoCmd.Close acForm, "窗體名", acSaveYes
'參數:acSaveYes=保存;acSaveNo=不保存;acSavePrompt=提示
End Sub