Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

適用對象

Screen 物件

您可以搭配 Screen 使用 ActiveForm 屬性來識別或參照包含焦點的表單。 唯讀 Form 物件。

expression.ActiveForm

表達 必要。 一個運算式,該運算式會返回應用程式至清單中的其中一個物件。

設定

此屬性設定包含焦點在執行階段之表單物件的參照。

您可在使用巨集或 Visual Basic for Applications (VBA) 程式碼時使用此屬性,且此屬性在所有檢視中都是唯讀。

備註

您可以使用 ActiveForm 屬性參照使用中的表單,與表單的其中一個屬性或方法。 以下範例會顯示使用中表單的 Name 屬性設定。

Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
MsgBox "Current form is " & frmCurrentForm.Name

如果焦點在子表單,ActiveForm 會參照主表單。 當您使用 ActiveForm 屬性時若焦點不在表單或子表單,系統會發生錯誤。

Need more help?

擴展您的技能

探索訓練 >

優先取得新功能

加入 MICROSOFT 365 測試人員 >

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?

Thank you for your feedback!

×