Looks like a crash while processing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I've got a DB that parses a file and sticks the values into the appropriate
places in a few tables. The parsing of my files works fine, but I'm trying
to clean up the operation, and I have a pet peeve that I can't seem to get
rid of.

When parsing begins, the screen starts repainting itself badly. For
example, if I open a window over the access window, then minimize it, the
'picture' of it is still overlapping my access form. Or if I switch back to
the access window, the screen is completely white.

I'd like to freeze everything and just display a message box saying
Parsing... or something similar. If I could get the '...' cycling so it
appears to be moving, that'd be cool too. I don't need a progress bar, as I
don't know how long each file will take until it's done. And they can vary
by a huge amount (ie, 14MB to 1MB).

I'd just like a visual cue to indicate the program didn't crash, it's just
working through the file.

If anyone can help me out or point me toward a helpful link, I'd appreciate
it.

Thanks,
Jay
 
Jay said:
Hi all,

I've got a DB that parses a file and sticks the values into the
appropriate places in a few tables. The parsing of my files works
fine, but I'm trying to clean up the operation, and I have a pet
peeve that I can't seem to get rid of.

When parsing begins, the screen starts repainting itself badly. For
example, if I open a window over the access window, then minimize it,
the 'picture' of it is still overlapping my access form. Or if I
switch back to the access window, the screen is completely white.

I'd like to freeze everything and just display a message box saying
Parsing... or something similar. If I could get the '...' cycling so
it appears to be moving, that'd be cool too. I don't need a progress
bar, as I don't know how long each file will take until it's done.
And they can vary by a huge amount (ie, 14MB to 1MB).

I'd just like a visual cue to indicate the program didn't crash, it's
just working through the file.

If anyone can help me out or point me toward a helpful link, I'd
appreciate it.

The first thing to do, if you're running code in a loop, is to use the
DoEvents statement every so often -- every iteration, or every n
iterations, depending on how tight the loop is. That will yield the
processor so that Access can process events.

Aside from that, you can certainly open your own form to display your
"Parsing..." message as a label, before you begin crunching, and set the
hourglass cursor on:

DoCmd.Hourglass True

Turn it off when you're done with

DoCmd.Hourglass False

Any code you may write to animate or to show a progress bar is going to
be dependent on using DoEvents to allow Access to repaint the screen, so
get that part done first.

--

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
That works like a charm! Except for one thing...

I placed a DoEvents at the end of the loop, so it repaints everything
correctly. But it also allows access to the form. Can I lock the form so
the user is forced to wait for the process to be completed? I can't find a
property to lock the form like a control has.

The hourglass works nicely though. Just have to work on the progress form.

Thanks!
Jay
 
Jay said:
That works like a charm! Except for one thing...

I placed a DoEvents at the end of the loop, so it repaints everything
correctly. But it also allows access to the form. Can I lock the
form so the user is forced to wait for the process to be completed?
I can't find a property to lock the form like a control has.

The hourglass works nicely though. Just have to work on the progress
form.

You can set the form's AllowEdits, AllowAdditions, and AllowDeletions
properties to False, temporarily. I'd be inclined, though, just to set
my "Please Wait" form's Modal property to Yes, so that when that form is
open the user won't be able to interact with any other form.
 
Got it, thanks!

Dirk Goldgar said:
You can set the form's AllowEdits, AllowAdditions, and AllowDeletions
properties to False, temporarily. I'd be inclined, though, just to set
my "Please Wait" form's Modal property to Yes, so that when that form is
open the user won't be able to interact with any other form.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top