G
Guest
I have several functions that I would like to run periodically as a user is
using my front-end. Specifically, I have a function that is run whenever a
form loads that will check to see if there is a new version available on the
network, or if the admin wants everyone to quit the application, etc. Not
too important. Either way, running this as a thread would work much better.
In pseudocode, this is what I'd like to do:
Start Thread1
Loop
if new version available then
start Thread2(2 minutes)
notify user
end if
Check for lockout
start Thread2(1 minute)
notify user
end if
wait 3 minutes
end loop
End Thread1
Start Thread2(X as integer)
Wait for X Minutes
Quit program
End Thread2
Basically what happens is every 3 minutes a check will run to see if there's
a new update available or if the admin wants to lock out the database (for
editing the back end tables, mainly).
If there is a new update available, a message box will tell the user that an
update is available, and that the program will automatically shut down in 2
minutes if they do not. When the user starts up the database again (via a
launcher executable) it will autotomatically download the new update.
If the admin wants to lock out the database (it's a yes/no value in a
table), the user will be notified with a message box and the front end will
close within 1 minute if they do not. The front-end will pop a message box
and automatically shut down if the user tries to log in.
I know it's a stretch to suggest that VBA can create and run thread
processes. But hell, it might be possible, so I'm throwing it out there.
Basically, I would like to learn how to run a thread, or how to fake one.
Thanks!
Nick
using my front-end. Specifically, I have a function that is run whenever a
form loads that will check to see if there is a new version available on the
network, or if the admin wants everyone to quit the application, etc. Not
too important. Either way, running this as a thread would work much better.
In pseudocode, this is what I'd like to do:
Start Thread1
Loop
if new version available then
start Thread2(2 minutes)
notify user
end if
Check for lockout
start Thread2(1 minute)
notify user
end if
wait 3 minutes
end loop
End Thread1
Start Thread2(X as integer)
Wait for X Minutes
Quit program
End Thread2
Basically what happens is every 3 minutes a check will run to see if there's
a new update available or if the admin wants to lock out the database (for
editing the back end tables, mainly).
If there is a new update available, a message box will tell the user that an
update is available, and that the program will automatically shut down in 2
minutes if they do not. When the user starts up the database again (via a
launcher executable) it will autotomatically download the new update.
If the admin wants to lock out the database (it's a yes/no value in a
table), the user will be notified with a message box and the front end will
close within 1 minute if they do not. The front-end will pop a message box
and automatically shut down if the user tries to log in.
I know it's a stretch to suggest that VBA can create and run thread
processes. But hell, it might be possible, so I'm throwing it out there.
Basically, I would like to learn how to run a thread, or how to fake one.
Thanks!
Nick