打开与关闭窗体的函数
将一些常用命令写成函数,以简化您的程序
如关闭窗体指令可将之写成以下形式放在模块中
Function strCloseForm(strFormName As String) As String
On Error GoTo strCloseForm_Err
DoCmd.Close acForm, strFormName
strCloseForm_Exit:
Exit Function
strCloseForm_Err:
MsgBox Error$
Resume strCloseForm_Exit
End Function
调用方法:关闭本窗体 strCloseForm(Me.Name)
关闭其它窗体 strCloseForm("FormName")
将一些常用命令写成函数,以简化您的程序
如关闭窗体指令可将之写成以下形式放在模块中
Function strCloseForm(strFormName As String) As String
On Error GoTo strCloseForm_Err
DoCmd.Close acForm, strFormName
strCloseForm_Exit:
Exit Function
strCloseForm_Err:
MsgBox Error$
Resume strCloseForm_Exit
End Function
调用方法:关闭本窗体 strCloseForm(Me.Name)
关闭其它窗体 strCloseForm("FormName")