|
试试LWWVB的XOPEN技术吧.
Public FormPoint(1 To 10) As Form ''FORM的堆记录
Public FormP As Integer ''堆指针
'''XOPen基本的功能
Public Sub OPenWin(ParentForm As Form, s As String)
If IsNull(ParentForm) = False Then
FormP = FormP + 1
Set FormPoint(FormP) = ParentForm
ParentForm.Visible = False
End If
DoCmd.OpenForm s, , , , , acDialog
End Sub
Public Sub CloseWin()
DoCmd.Close
End Sub
Public Sub PrintReport(ParentForm As Form, RptName As String, Optional 预览打印 As Boolean = True)
FormP = FormP + 1
Set FormPoint(FormP) = ParentForm
ParentForm.Visible = False
DoCmd.OpenReport RptName, IIf(预览打印, acViewPreview, acViewDesign)
If 预览打印 Then DoCmd.Maximize
End Sub
Public Sub ShowWin()
FormPoint(FormP).Visible = True
FormP = FormP - 1
End Sub
在每个Form和Report的close或Unload中加入showwin这句.打开form或report时用Openwin /PrintReport方法就行.
唉,ACCESS呀ACCESS,连个继承都没有.每个FORM和REPORT都加上这个showwin,真是累坏了大家.
随便对大家说一声,本人已经转了DELPHI,原来ACCESS的疑难问题一扫而空.发现DELPHI做数据库不知道要比ACCESS爽多少倍.[em05] |
|