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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple msgbox thread 1

Status
Not open for further replies.

Kuljack

Technical User
May 15, 2014
11
US
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>")

[highlight #FCE94F] 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>")[/highlight]


End if


End Sub
 
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
 
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!
 
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top