here is my complete code in frmannounce and frmnumber
frmannounce
Code:Private Sub cmdsend_Click() Text1.Text = frmnumber.lblannounce.Caption frmnumber.Show Unload Me End Sub
frmnumber
my only problem is when updating the announcement when the frmnumber is loaded it wont update so inneed to exit the program first then update the announcement...Code:Option Explicit Private spk As SpVoice Private Declare Function Beep Lib "kernel32" _ (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long Private Sub Abouts_Click() frmAbout.Show End Sub Private Sub Announce_Click() frmannounce.Show End Sub Private Sub Exit_Click() Dim response As String response = MsgBox("Are You Sure You Want To Close The Program", vbYesNo, "Exit") If response = vbYes Then End Else Me.Show End If End Sub Private Sub SpeakIt(strWords As String) If strWords <> vbNullString Then spk.Speak strWords End If End Sub Private Sub Form_Load() lblannounce.Caption = "You can check the status of your document online with your tracking number Icon... " & frmannounce.Text1.Text & "... " Timer1.Enabled = True Timer1.Interval = 300 Set spk = New SpVoice Dim cx As Long Dim cy As Long Dim RetVal As Long lbldate.Caption = Format(Now, "mmmm dd,yyyy") Timer1.Interval = 200 'playing sound Dim app_path As String app_path = App.Path If Right$(app_path, 1) <> "\" Then app_path = app_path & "\" txtmusic.Text = app_path & "BuddyIsOnline.wav" End If With mmcplayer .Notify = False .Wait = True .Shareable = False .Command = "close" End With End Sub Private Sub mmcplayer_done(notifycode As Integer) mmcplayer.Command = "close" lblaudio.Caption = "" End Sub Private Sub mmcplayer_statusupdate() lblaudio.Caption = mmcplayer.Position & "/" & mmcplayer.Length End Sub Private Sub lblreceive_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 1 Then lblreceive.Caption = Val(lblreceive.Caption) + 1 SpeakIt "Now Serving Number" & lblreceive.Caption & "at receiving window" With mmcplayer If lblreceive.Caption = lblreceive.Caption <= 30 Then .FileName = txtmusic.Text .Command = "open" .Command = "play" Else .Command = "stop" .Command = "close" End If End With End If If lblreceive.Caption = 31 Then lblreceive.Caption = "0" End If If Button = 2 Then lblreceive.Caption = Val(lblreceive.Caption) - 1 End If Dim response As String If lblreceive.Caption < 0 Then response = MsgBox("Reset to 0", vbExclamation, "ERROR") lblreceive.Caption = Val(lblreceive.Caption) + 1 End If End Sub Private Sub lblrelease_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 1 Then lblrelease.Caption = Val(lblrelease.Caption) + 1 SpeakIt "Now Serving Number" & lblrelease.Caption & "at releasing window" With mmcplayer If lblrelease.Caption = lblrelease.Caption <= 30 Then .FileName = txtmusic.Text .Command = "open" .Command = "play" Else .Command = "stop" .Command = "close" End If End With End If If Button = 2 Then lblrelease.Caption = Val(lblrelease.Caption) - 1 End If If lblrelease.Caption = 31 Then lblrelease.Caption = "0" End If If lblrelease.Caption < 0 Then Dim response As String response = MsgBox("Reset to 0", vbExclamation, "ERROR") lblrelease.Caption = "0" End If End Sub Private Sub Timer1_Timer() lblhr.Caption = Format$(Now, "hh:mm:ss AM/PM") Dim str As String str = frmnumber.lblannounce.Caption str = Mid$(str, 2, Len(str)) + Left(str, 1) frmnumber.lblannounce.Caption = str End Sub
thanx...




Reply With Quote