Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making code run in the background

Status
Not open for further replies.

actuaryinworks

Technical User
Apr 2, 2006
7
CA
Hi all,
Every time I run a VBA macro from Access, it makes my computer super slow and sometimes it even freezes until the code finishes running. Is there a command to make the code execture in the background without affecting my computer performance too much?
 
[tt]DoEvents[/tt]?

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Access (at least the parts of the code that you write) is single-threaded so there isn't really any way for you to have "background" tasks unless you want to get into Windows API calls and that's not a simple solution. There are some ADO (not DAO) tasks than can be started async but, if what you are doing doesn't involve database access activiites, then that doesn't help.

Another option that comes to mind is to have separate programs that you run with Shell that run asynchronously. If the tasks are really processor or I/O or memory intensive however, that probably won't help much. Your system is still going to be busy. Maybe you just need more horsepower on your desktop.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top