0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AccessのVBAで一定時間待つ処理

Posted at

やり方

'AccessにはWaitのような機能(関数)が無いので、kernel32.dllの力を借りる。
'ここでWindowsAPIのkernel32.dllに含まれているSleepという機能を参照して、
'VBA内で使えるように宣言している。
Private Declare Sub Sleep Lib "kernel32" (ByVal sleep_milli_second As Long)

Private Function Tester()
    Debug.Print Now()
    Sleep 5 * 1000 '5秒待つ
    Debug.Print Now()
End Function

バージョン

Windows 10 Pro 21H2 OSビルド 19044.2130
Microsoft Access for Microsoft 365 MSO (バージョン 2209 ビルド 16.0.15726.20068) 32 ビット

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?