• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Temp Message Box

Hello,

I'm using VB Script and need to launch a message box for a couple of seconds and then close. Basically when a button is pressed this message will appear stating something like "Please Wait Launching Program" and then disappear.

Thanks
Clinton
0
Clinton112299
Asked:
Clinton112299
1 Solution
 
SonofyodaCommented:
There is a 'wait' API call, but I don't think this works in scripting ...

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)



Where sleep(1000) will wait 1 second
0
 
dwphilippeCommented:
I don't know how VB Script works but in VB6 I solve the problem like this:
Instate to show a msgbox you can show a form. When the form is showed you start a timer and when the timer is finished you close the form again.

I don't know if this helps you
0
 
tgraffhamCommented:
Are you using VB Script from Access or ASP or what?

If this is an Access database, no problem.  Create a form that looks like your message box with no buttons just the test.  Give that form an OnTimer event that says simply "DoCmd.Close acForm, Me.Name" and then set the Timer Interval higher and higher until you're happy with how long it stays up.  Start with about 5000 or so or you won't hardly see the form at all.

Hope this helps,
Tim
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Clinton112299Author Commented:
Hello,

THis is the first time using the VB editor and things are very limited on what I can do. So far I can't figure out how to close the Msgbox once I open it. Also applies to Forms, it's always waiting for someone to press the X button. ANy ideals on what to do?

This is what I have so far;

MsgBox ("Please Wait..........")
IntCount = 1
Do While IntCount <= 10
IntCount = IntCount + 1
Loop

THe problem with this is that the Msgbox is open and will NOT drop down for the rest of the code unitl I press and close it.

What I pain in the *@*#^*@#

Clinton
0
 
dwphilippeCommented:
Clinton,

What you say is true. When you call a msgbox the program will stop until an user action.
That's the reason why I say to work with a form.

You make a form2 with your message and a timer1.
In form1 you add the code:
  form2.show 1
In the timer1 of form2:
  unload me

Now when you ask to show form2, the form will show and the timer start to count down. When he is on zero he unload hisselve and go farther with the code after form2.show 1.

Good luck
0
 
Clinton112299Author Commented:
Thanks,

I ended up using a form.

Clinton
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now