0

I have an MS Access form, that contains a subform whose recordset is a query that takes quite a while to process and isn't actually needed right away when the parentform is opened, but only after a button on the form is pressed.

Is there a way to implement this with VBA other then completely changing the form with something like Set Me.MySubForm.Form.Recordset = NULL? I've tried Me.MySubForm.Enabled = False but that doesn't work unfortunately.

4

1 回答 1

0

最简单的方法:

将子窗体控件的SourceObject属性留空。然后当按下按钮时,执行

Me.MySubForm.SourceObject = "mySubFormName"

这样子表单及其数据在需要时才被加载。

于 2016-11-11T15:48:37.723 回答