I have a general module, TMSTextServer Function, that runs 24/7 and services commands received via Twilio log extractions. That all works quite well. Using the term loosely, the "server" is started via an AutoExec macro that runs the following module:
"ServerCode" is global string and is sometimes set to "ReStart" when the server needs to be restarted, while other times there might be a case where the server needs to shut down as can be seen when "ServerCode" has been set to "Stop". I tried putting a DoEvents before the DoCmd.Quit but I stll get a runtime 2046 error.Code:Option Compare Database Option Explicit Public Function ServerFrontGate() While 1 = 1 Call TMSTextServer If ServerCode = "Stop" Then DoCmd.Quit Wend End Function
Any thoughts as to what might be causing the DoCmd.Quit failure?