【发布时间】:2016-10-09 05:20:36
【问题描述】:
我正在使用 Allen Browne 的方法来创建和管理表单的多个实例。我被困在如何从 VBA 模块引用表单的特定实例上的控件或属性。以下是我打开新实例的方法:
'Purpose: Open an independent instance of form frmMasterRecord.
Dim frm As Form
'Housekeeping
myFilter = Trim("" & myFilter)
'Open a new instance, show it, and set a caption.
Set frm = New Form_frmMasterRecord
frm.ServerFilter = myFilter
frm.ServerFilterByForm = True
frm.Requery
frm.Visible = True
'Append it to our collection.
clnMasterRecord.Add Item:=frm, Key:=CStr(frm.hwnd)
Set frm = Nothing
假设我打开了三个 frmMasterRecord 实例。如何在模块中调用子/函数并让它仅在表单的调用实例上操作控件?
【问题讨论】:
-
你试过的代码是什么?
标签: vba forms ms-access controls instance