Windows Access Countdown Timer Trigger (VBA)

May 9, 2017 at 01:13:06
Specs: Windows 7
I'am quite new to VBA & ms Access so please bear with me.

I'am looking for a countdown timer which is triggered everytime a new file is added or created in a specific folder.

It should start at 7 minutes and run down to 0. If a new file has been added/created the timer should go back to 07:00 and redo the process.

My clock timer now only works manually:
_____
Option Compare Database
Option Explicit

Private Sub Command4_Click()
Me.TimerInterval = 1000
Me.Text2 = Me.Text0
End Sub

Private Sub Form_Timer()
If Format(Me.Text2, "hh:nn:ss") = #12:00:00 AM# Then
MsgBox "Time is up"
Me.TimerInterval = 0
Else
Me.Text2 = DateAdd("s", -1, Me.Text2)
End If
End Sub
______
Thanks for reading and all the help in advance.


See More: Windows Access Countdown Timer Trigger (VBA)

Report •

#1
May 16, 2017 at 03:10:40
You can add the timer to your form along with the countdown interval. You can then build an event which will do the magic when your trigger condition is met.

Will the folder contain more than one file?
or will the file be deleted and a new one added?

I ask this because the code required for this will change considerably depending on the how the files/folder will behave.

The timer itself can easily be reset when a folder is modified.

Final question will the path to this folder be a UNC (network path) beginning with // or is this a stand alone pc? C:\.......\Folder\


Report •
Related Solutions


Ask Question