MsgBox

D

dhstein

I have a process that runs for a while and I want to display a message for
every 1000 records that are processed so the user knows that it's still
running. But I don't want to require any user action. Can a Msgbox be coded
without the need to hit OK or do I need to do something else? Thanks for any
help on this.
 
J

John Spencer

No, you cannot use a msgbox. Msgbox always requires user interaction.

What you can do is use a form you have designed and display it with a
progress message.

Former MVP Sandra Daigle has a nice selection of Progress Bars and forms:

http://www.daiglenet.com/Samples/ProgressMeter.ZIP

There is also one at Arvin Meyer's website:

http://www.datastrat.com/Download/ProgressBar2K.zip

OR see Tony Toews
http://www.granite.ab.ca/access/progressbar.htm

or have a look at this sample file on the Access Web:
http://www.mvps.org/access/downloads/ProgressBarR1.3.zip
It is for Access 97, but converts easily to Access 2000 and later.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
D

dhstein

John and Chris,

Thanks for your replies, I'll check out the examples. I'm a little
surprised that there's no way to put out a message without requiring a user
response. What if I wanted to display a digital clock with time and change
the readout every minute. That would seem to require text output to the
screen without user response.
 
J

John Spencer

Well, if you were doing the clock thing, it would not be using the
MsgBox function. It would be using a form and that can be done.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
D

dhstein

That was just the best example I could think of where you might want to
display text on a screen. Yes that would be in a form - and that gives me
the idea of updating a field with the count of records processed (every 1000
for example) - which might be exactly what I need. Thanks.
 
J

John Spencer

Ok, but be aware that you are going to need to use
DoEvents
to release control of the processor so the update to the form can be
done. AND you will probably have to force a screen update.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
D

dhstein

John,

I just created a text box and in my loop where I'm processing records:

If RecordCount Mod RecordInterval = 0 Then
txbRecordCount.Value = RecordCount
End If


It works fine. Thanks.
 
A

Arvin Meyer MVP

John Spencer said:
No, you cannot use a msgbox. Msgbox always requires user interaction.

What you can do is use a form you have designed and display it with a
progress message.

Former MVP Sandra Daigle has a nice selection of Progress Bars and forms:

http://www.daiglenet.com/Samples/ProgressMeter.ZIP

Sandra's site is now at AccessMVP.com. Although it may still be at
daiglenet, the site is now used only by here family. The new url is:

http://www.accessmvp.com/SDaigle/ProgressMeter.ZIP
 
J

John Spencer

Interesting, because when I used the URL I posted I was prompted to
download the sample zipped file.

I will update my notes. Thanks for the information.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
D

dhstein

John,

I owe you an apology. The code worked fine at home, but in the production
environment it did not. So I needed the DoEvents() Thanks for mentioning
that - otherwise, I would have had no clue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top