Thanks Dargathi,
I used your advice, but only had partial success though.
I used the OnClose option on my form (because it runs the macro if either the form is closed or Access is exited while the form is open.) to run a macro. The macro uses 'RunApp' to call the Batch file from desktop. A DOS window appears,and then a warning type dialog box appears, which I click 'OK' to "...quit the program and Windows...". But, I wait for minutes and pc doesn't shut down!
I hit CTRL+ALT+DEL and use 'EndTask' on the batch file, and it is only then that the pc shuts down!!
I tested the batch file when no other applications are running, and it worked as expected. ie I double-clicked its icon on desktop, a DOS window appeared, and then I was confronted with a warning dialog box which needed me to click 'OK' to "...quit the program and Windows...". The pc shut down.-Perfect.
I just use the following code in the batch file:
C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows
Do I need to add a line of code to first close Access, and if so, could you please tell me what that code is?
FYI. I don't use VB at all, and am only self taught in Access. Thanks for the VB and API inputs...I must give them some time, sometime. Excuse the pun.