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!

MsgBox without a button?

Status
Not open for further replies.

merlynsdad

Programmer
Nov 18, 2010
175
US
I'm trying to keep the end user informed as to what an Access database is doing, while it's looping through data, without him having to do anything but watch. I haven't found a way to use a MsgBox without the user having to press a button, which I don't want. Do I need to open and close a form, or is there a way to do this with a MsgBox?

If the square peg won't fit in the round hole, sand off the corners.
 

What do the user SEE "while [Access database is] looping through data"? Is it a UserForm?

If so, you can dis-able all controls on the Form, and display a frame in the middle with some message (a label?) "Just seat and enjoy... I am working on it."

After it is done, hide the frame (Visible = False) and (re) enable all controls back for the user.

You may want to do something with the upper-right X on the Form, too.

Would that work?

Have fun.

---- Andy
 
How are ya merlynsdad . . .

How about a [blue]progress bar[/blue] that repeats. Its a form with no min, max or close button. Just have your code open & close the form as needed. Since there's no close button, don't forget to copy the [blue]AutoKeys[/blue] macro. The keys [blue]Shift+Ctrl+Q[/blue] close the form manually.

Repeating Progress Bar

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Have you thought about adding a Label to your form, and diplaying a "xxx Records Processed" message? Assume you add a Label control called lblMessage. The extra bits of code you would need are:

Code:
Dim lnCounter as long


(The start of your loop)



    lnCounter = lnCounter + 1
    if lnCounter MOD 100 = 0 then
        lblMessage = cstr(lnCounter) & " Records Processed"
        DoEvents
    end if
(The end of your loop)

The if test with MOD causes the message to update every 100 records, so it doesn't slow down the main processing loop and prevents the message from flickering

If the message changes too often, or not often enough, make the number after MOD larger or smaller respectively.


Bob Stubbs (London, UK)
 
Bob, I'd change this:
lblMessage =
with this:
lblMessage.Caption =
 
All of these suggestions are good, but my bosses don't want any of them. I need to show the LOCATION that is currently processing through the loop. I have a form called EndUserPopup that contains a label that says "Now processing data from", and a text box called Location. There are two places where I can pull the location from; Oracle, or the table/field in the Access database where I'm dumping the Oracle data (Agent!Location). Right now, either method is giving me a #Name? error in the text box so I'm doing something wrong. I just odn't know what I'm doing wrong!

If the square peg won't fit in the round hole, sand off the corners.
 
I figured it out.

DoCmd.OpenForm "EndUserPopup"
Forms!EndUserPopup!location = rst1![ACD].Value

and once the loop ends

DoCmd.Close acForm, "EndUserPopup"

Thanks to all.

If the square peg won't fit in the round hole, sand off the corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top