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.

您可以在 Access 桌面資料庫中使用 RemoveAllTempVars 宏指令來移除您使用 SetTempVar 宏指令所建立的任何暫時變數。

設定

RemoveAllTempVars 宏指令沒有任何自變數。

註解

  • 您最多可以一次定義 255 個暫時變數。 如果不移除暫時變數,該變數會保留在記憶體中,直到您關閉資料庫或項目為止。 當您完成使用時,最好移除暫時變數。

  • Access 會在您關閉資料庫或專案時自動移除所有暫時變數。

  • 若要移除單一暫時變數,請使用 RemoveTempVar 宏指令,並將自變數設定為您要移除的暫存變數名稱。

  • 若要在 VBA 模組中執行 RemoveAllTempVars 宏指令,請使用 TempVars 物件的 RemoveAll 方法。

範例

下列宏示範如何建立暫時變數、在條件和消息框中使用它,然後使用 RemoveAllTempVars 宏指令移除暫存變數。

條件

動作

引數

SetTempVar

名稱:MyVar

表達式:InputBox (「輸入非零數位」。)

[TempVars]![MyVar]<>0

MsgBox

訊息:=“You enter ” & [TempVars]![MyVar] & “”。

BeepYes

類型資訊

RemoveAllTempVars

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!

×