×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Multiple msgbox thread

Multiple msgbox thread

Multiple msgbox thread

(OP)
I'm trying to build a macro that runs through a designated list of screens based on the answer to a previous msgbox. I'm new to macros in attachmate, so this may be a simple step I'm missing but I just started teaching myself today.

The first two paths for either a yes or no response work fine, but it's when we meet the second fork that ties to two paths together where it doesn't work. It will just play out the rest of the feed, and it won't allow me to place a second "else" for the second response. Any guidance would be greatly appreciated!


strPriority=MsgBox ("Was this an inbound Call?",4 ,"Compliance tool")


' If you answer yes
If strPriorityDelete = "6" Then
Sess0.Screen.Sendkeys("<Home>dlq1<Enter>")
Sess0.Screen.Sendkeys("<Home><Tab><Tab>mort<Enter>")
MsgBox"Verify customer name, property address, mailing address, and last four of social security number. Also look for cease and desist banner as well"
Sess0.Screen.Sendkeys("<Home>mem1<Enter>")
MsgBox"Verify all A3P/Attorney contacts in MEM1"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Home>saf1<Enter>")
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"Verify the cease and desist code"
Sess0.Screen.Sendkeys("<Home>dlq1<Enter>")
msgbox"Review mancode to read appropriate disclaimer and recording script"
Sess0.Screen.Sendkeys("<Home>dlq8<Enter>")
MsgBox"Verify all contact numbers on the account"
Sess0.Screen.Sendkeys("<Home>for1<Enter>")

' If you answer no

Else
Sess0.Screen.Sendkeys("<Home>dlq1<Enter>")
Sess0.Screen.Sendkeys("<Home><Tab><Tab>mort<Enter>")
MsgBox"Verify customer name, property address, mailing address. Also look for cease and desist banner as well"
Sess0.Screen.Sendkeys("<Home>mem1<Enter>")
MsgBox"Verify all A3P/Attorney contacts in MEM1"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Home>saf1<Enter>")
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"Verify the cease and desist code"
Sess0.Screen.Sendkeys("<Home>dlq1<Enter>")
msgbox"Review mancode to read appropriate disclaimer and recording script"
Sess0.Screen.Sendkeys("<Home>dlq8<Enter>")
MsgBox"Verify all contact numbers on the account"
Sess0.Screen.Sendkeys("<Home>for1<Enter>")

strPriority=MsgBox ("Is the foreclosure active?",4 ,"Foreclosure status")

' If you answer yes
MsgBox"Verfiy foreclosure status, click okay to continue"
Sess0.Screen.Sendkeys("<Home>for3<Enter>")
MsgBox"Review for U20, click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Home>lmt1<Enter>")
MsgBox"Review status and assigned SPOC, offer to transfer call to SPOC or handle the call. Inform customer you will email the HPS of the call if handled by you"
Sess0.Screen.Sendkeys("<Home>lmtn<Enter>")


' If you answer no


MsgBox"Verfiy foreclosure status, click okay to continue"
Sess0.Screen.Sendkeys("<Home>lmt1<Enter>")
MsgBox"Review status and assigned SPOC, offer to transfer call to SPOC or handle the call. Inform customer you will email the HPS of the call if handled by you"
Sess0.Screen.Sendkeys("<Home>lmt3<Enter>")
MsgBox"If Foreclosure status was inactive/suspended review for a populated L14. If blank, solicit payment per hierarchy"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Pf8>")
MsgBox"click okay to continue"
Sess0.Screen.Sendkeys("<Home>lmtn<Enter>")



End if


End Sub

RE: Multiple msgbox thread

maybe something like this with nested if statements?

CODE

If strPriority = "6" Then
    'your code
Else
    If strPriority = "7" Then
        'your code
        If strPriority = "6" Then
            'your code
        Else
            If strPriority = "7" Then
                'your code
            End If
        End If
    End If
End If 

RE: Multiple msgbox thread

(OP)
Thank you! I will test this theory and let you know the outcome. Do you know what produces the value of the response? It seems like for some code the numbers provide preset options, for example the 4 in the priority msgbox provides a yes/no option while a 5 ends up with a yes/no/cancel.

Does the six present yes and seven a no on this scenario. I've been taking code from current macros available to try and make sense of the madness but it's all been a guessing game for me. A friend referred me to this site for guidance and I've already begun to learn from threads.

I appreciate your help!

RE: Multiple msgbox thread

Kuljack, some of this information was found in the HELP files, although i know it is hard to find bigsmile
i don't remember where i got this. this should explain how the popup works. btw, this works with VBA.

CODE

Sub Main()
    
    'button group/icon group/default group
    
        
    'Buttons                            Value
    'OK only                            0
    'OK, Cancel                         1
    'Abort, Retry, Ignore               2
    'Yes, No, Cancel                    3
    'Yes, No                            4
    'Retry, Cancel                      5
    
    'Icons                              Value
    'Critical Message (Stop sign)       16
    'Warning Query (Question mark )     32
    'Warning Message (Exclamation)      48
    'Information Message (lower-case i) 64
    
    'this sets the default button
    'Button Defaults                    Value
    'First button                       0
    'Second button                      256
    'Third button                       512
    
     
    'Value  Button Pressed
    '1  OK
    '2  Cancel
    '3  Abort
    '4  Retry
    '5  Ignore
    '6  Yes
    '7  No
      
   
    msgtex = "Continue?"
    
    answer = MsgBox(msgtex, 3 + 16 + 512, "HELLO") 'Red X
    
    answer = MsgBox(msgtex, 3 + 32 + 512, "HELLO") 'Question Mark Icon
    
    answer = MsgBox(msgtex, 3 + 48 + 512, "HELLO") 'Yellow Triangle/Exclamation
    
    answer = MsgBox(msgtex, 3 + 64 + 512, "HELLO") 'Information Icon
    
    
    MsgBox answer
    
    '//------------------------
    
    
    Msg$ = "Are you absolutely sure you want to delete "
    
    rc% = MsgBox(Msg$, 64, 512)
    
    Msg$ = "Are you absolutely sure you want to delete "

    Ansr% = MsgBox(Msg$, 4)


    Dim btngrp As Integer
    Dim icongrp As Integer
    Dim defgrp As Integer
    Dim msgtext As String
    icongrp = 16
    defgrp = 0
    btngrp = 0
    Do Until btngrp = 6
      Select Case btngrp
         Case 1, 4, 5
            defgrp = 0
         Case 2
            defgrp = 256
         Case 3
            defgrp = 512
       End Select
       msgtext = "  Icon group = " & icongrp & Chr(10)
       msgtext = msgtext + "   Button group = " & btngrp & Chr(10)
       msgtext = msgtext + "   Default group = " & defgrp & Chr(10)
    
       msgtext = msgtext + Chr(10) + "   Continue?"
       answer = MsgBox(msgtext, btngrp + icongrp + defgrp)
       Select Case answer
         Case 2, 3, 7
           Exit Do
       End Select
       If icongrp <> 64 Then
          icongrp = icongrp + 16
       End If
       btngrp = btngrp + 1
    Loop


End Sub 

step through the code and you will see how this works. happy programming!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close