Progress Bar with Long Running VB code

PianoMan

New member
Local time
Today, 09:43
Joined
Nov 18, 2009
Messages
1
I'm importing several hundred thousand records into a SQL database. I created a class\Code Module to display the standard progress bar. When I run the progress bar from test code everything works just fine. The progress bar shows up, the progress bar grows in size, and eventually is removed at the end of the test.

When I use the progress bar class in the actual application the progress bar is initially displayed. But eventually the Access app window goes blank and Access displays "Not Responding" in the title bar. I can't see the progress bar anymore.

The import process takes 1.5 hours.

Everytime I update the progress bar I call RepaintObj

DoCmd.RepaintObject
'Application.Screen.ActiveForm.Repaint
Call SysCmd(acSysCmdUpdateMeter, m_LinesRead)

As you can see I tried calling Repaint on the active form but that didn't work either.

Any suggestions?

Ed
 
Access is single threaded and unless you have a logical breaking point in your code it is not likely you can keep a progress bar running.
 
Try putting

DoEvents

into your code.
 

Users who are viewing this thread

Back
Top Bottom