Shell command only works in Debug mode

Posted on 2011-10-27
Medium Priority
Last Modified: 2012-05-12
This is driving me a little stir crazy.
I have written a function which executes a shell command to create a tasklist file. It appears the only way that it will work is if I actually step through the command in debug mode. Not sure what I'm doing wrong here.
I've attached a small app to illustrate the problem.
When you open the app, the form has a 'checkbox' labelled "Step through the Shell command". If you click the 'Load the task list' command button, while the checkbox is checked, the function will stop just prior to where the Shell command is executed. If you press CTRL+8 twice to actually step through the Shell command, the text file is created.
Now try clicking the 'Load the task list' command button, while the checkbox is not checked, an error is generated because the file isn't created.
Can anyone explain to me what is happening here and why?

- It's really late and I'm going to try to get some sleep for a few hours. I'll check on this when I get up.
Question by:shambalad
LVL 40

Accepted Solution

als315 earned 2000 total points
ID: 37043398
I think you should wait for result of command. task need some time to prepare csv file.
May be this link can help:

Author Closing Comment

ID: 37043661
Thank you very much.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question