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.

適用對象

BoundObjectFrame 物件

Label 物件

Rectangle 物件

CheckBox 物件

ListBox 物件

Section 物件

ComboBox 物件

ObjectFrame 物件

TabControl 集合物件

CommandButton 物件

OptionButton 物件

TextBox 物件

Form 物件

OptionGroup 物件

ToggleButton 物件

Image 物件

Page 物件

設定或傳回「適用對象」清單中其中一個物件之 [屬性] 視窗的 [按一下] 方塊值。 讀/寫字串

expression.OnClick

運算式 必要。 傳回 [套用至] 清單中其中一個對象的表達式。

備註

若要以程式設計方式變更 Microsoft Office Access 2007 在觸發事件時所採取的動作,此屬性非常實用。 例如,在事件呼叫期間,您可能會想根據所觸發之事件的情況變更運算式參數,或是從事件程序切換至運算式或巨集。

當使用者在物件上按下滑鼠左鍵並放開時,會發生 Click 事件。

根據 [選擇建立器] 視窗 (存取方式為按一下物件 [屬性] 視窗中,[按一下] 方塊旁的 [建立] 按鈕) 中所選擇的選項而定,OnClick 值會是下列其中一項:

  • 如果選擇 [運算式建立器],值會是 "=expression",其中的 expression 會是 [運算式建立器] 視窗提供的運算式。

  • 如果選擇 [巨集建立器],則值會是巨集的名稱。

  • 如果選擇 [程式碼建立器],則值會是 "[事件程序]"。

如果 [按一下] 方塊是空白的,則屬性值為空字串。

範例

下列範例會將 Click 事件與名稱為 [確定] 按鈕 (位於 [訂單項目] 表單) 上的 "OK_Click" 事件相關聯,前提是該處目前尚未有任何關聯。

With Forms("Order Entry").Controls("OK")
If .OnClick = "" Then
.OnClick = "[Event Procedure]"
End If
End With

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×