display a message

  • Thread starter Thread starter manoj
  • Start date Start date
M

manoj

I would like to have the message in a message box appear
letter by letter.

I tried the following code

Strmsg = "some message to be displayed"
for I = 1 to len(strmsg)
dispmsg = left (strmsg,I)
msgbox dispmsg
next i

It works fine. But each time one letter of the message is
displayed I have to click the ok button. Can anyone
suggest an alternative

Thanks
Manoj
 
I would like to have the message in a message box appear
letter by letter.

I tried the following code

Strmsg = "some message to be displayed"
for I = 1 to len(strmsg)
dispmsg = left (strmsg,I)
msgbox dispmsg
next i

It works fine. But each time one letter of the message is
displayed I have to click the ok button. Can anyone
suggest an alternative

Thanks
Manoj

Don't use the built-in MsgBox use an unbound form instead.

Create a new unbound form.
Add a Label control.
Size it big enough to display the entire message.
Name the Label "Show"

Code the Form's Timer event:

Private Sub Form_Timer()
Static I As Integer
I = I + 1
strMsg = "some message to be displayed"
If I > Len(strMsg) Then Exit Sub
Show.Caption = Show.Caption & Mid(strMsg, I, 1)
End Sub

Set the Form's Timer Interval property to
500 (for 1/2 second)

Name the form "frmMessage"

You can open the form from wherever you would open the regular MsgBox
by using
DoCmd.OpenForm "frmMessage", , , , , acDialog
 
Thank you Mr. Fred, It works great.
-----Original Message-----


Don't use the built-in MsgBox use an unbound form instead.

Create a new unbound form.
Add a Label control.
Size it big enough to display the entire message.
Name the Label "Show"

Code the Form's Timer event:

Private Sub Form_Timer()
Static I As Integer
I = I + 1
strMsg = "some message to be displayed"
If I > Len(strMsg) Then Exit Sub
Show.Caption = Show.Caption & Mid(strMsg, I, 1)
End Sub

Set the Form's Timer Interval property to
500 (for 1/2 second)

Name the form "frmMessage"

You can open the form from wherever you would open the regular MsgBox
by using
DoCmd.OpenForm "frmMessage", , , , , acDialog

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top