×
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

How to keep a dialogbox open?

How to keep a dialogbox open?

How to keep a dialogbox open?

(OP)
Hello All,
I've learned a lot from this this forum, such as getting data from AttachMate to Excel, writing subroutines, and much more.
Finally have a chance to post some code and ask for help!
Decided to be more productive at work, i have programmed a panel of buttons to go to various screens of AttachMate.  The problem is that i am having is that every time i click on a button AttachMate would open/go-to the screen but the dialog box will close afterward.

I would like the dialog box to stay open so that i can go from screen to screen by clicking the buttons to view various data for the customer.
 
I read that in another post that the Function will need to be set to true, but i don't have a function, nor do i know how to write one...sorry if  i am not clear. Please point me in the right direction.

Thanks

CODE

Sub Main()

'--------------------------------------------------------------------------------
            Dim Sessions As Object
            Dim System As Object
            Set System = CreateObject("EXTRA.System")     ' Gets the system object
            If (System is Nothing) Then
                        Msgbox "Could not create the EXTRA System object.  Stopping macro playback."
                        STOP
            End If
            Set Sessions = System.Sessions
            If (Sessions is Nothing) Then
                        Msgbox "Could not create the Sessions collection object.  Stopping macro playback."
                        STOP
            End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
            g_HostSettleTime = 500             ' milliseconds
            OldSystemTimeout& = System.TimeoutValue
            If (g_HostSettleTime > OldSystemTimeout) Then
                        System.TimeoutValue = g_HostSettleTime
            End If
' Get the necessary Session Object
            Dim Sess0 As Object
            Set Sess0 = System.ActiveSession
            If (Sess0 is Nothing) Then
                        Msgbox "Could not create the Session object.  Stopping macro playback."
                        STOP
            End If
            If Not Sess0.Visible Then Sess0.Visible = TRUE
            Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'--------------------------------------------------------------------------------

Dim strMembersNumber as String
Dim strMembersID as String
Dim strAH as String
Dim strI2  as String
Dim strXX as String
strAH= "ah"
strI2  = "i2"

Begin Dialog dlgGetMembersNumber 126, 61, 110, 45, "members info"
      OkButton 4, 30, 31, 15
      CancelButton  75, 29, 31, 10
      TextBox 3, 16, 105, 12, .tbxNumber
     Text 5, 4, 105, 8, "Enter Member's Number"
End Dialog

Begin Dialog dlgSearchPanel 0, 0, 244, 128, "selection box"
   ButtonGroup .AllButtons
   PushButton  1, 32, 45, 12, "Screen1.btnDoSendkeys1
   PushButton  48,32, 45,12, "Screen2",   .btnDoSendkeys2
   PushButton  1, 52, 45, 12, "Screen3",   .btnDoSendkeys3
   PushButton  48,52, 45,12, "Screen4",  .btnDoSendkeys4
   PushButton  1, 72, 45, 12, "Screen5",   .btnDoSendkeys5
   PushButton  47,72, 45,12, "Screen6.", .btnDoSendkeys6
   PushButton  0, 92, 45, 12, "Screen7",   .btnDoSendkeys7
   PushButton  48,92, 45,12, "Non-US ATM", .btnDoSendkeys8
   OptionGroup .OptionGroup1
      OptionButton  3, 21, 31, 8, "AH",.OptionButton1
      OptionButton  46,21,31,8,"I2",   .OptionButton2
   GroupBox  0, 10, 100, 99, "Transaction History"
   PushButton  104, 33, 45, 12, "Screen8",    .btnDoSendkeys9
   PushButton  150, 32, 45, 12, "Screen9",    .btnDoSendkeys10
   PushButton  104, 53, 45, 12, "Screen10",    .btnDoSendkeys11
   PushButton  151, 53, 45, 12, "Screen11",    .btnDoSendkeys12
   PushButton  104, 73, 45, 12, "Screen12",    .btnDoSendkeys13
   PushButton  152, 72, 45, 12, "Screen13",    .btnDoSendkeys14
   PushButton  102, 92, 45, 12, "Screen14",    .btnDoSendkeys15
   PushButton  150, 92, 45, 12, "Screen15", .btnDoSendkeys16
   PushButton  198, 53, 45, 12, "Screen16",    .btnDoSendkeys17
   PushButton  198, 32, 45, 12, "Screen17",.btnDoSendkeys18
   PushButton  89, 115, 45, 12, "Next",    .btnDoSendkeys19
   PushButton  140, 115, 45, 12,"Close",   .btnDoSendkeys20
End Dialog

Dim GetMembersNumber as dlgGetMembersNumber
On Error Resume next
Dim SearchPanel as dlgSearchPanel
On Error Resume next

Dialog GetMembersNumber
strMembersNumber= GetMembersNumber.tbxNumber
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")           
        Sess0.Screen.Sendkeys("xxxx<Enter>")
        Sess0.Screen.Sendkeys("<Enter>")
        Sess0.Screen.Sendkeys(strMembersNumber)
        Sess0.Screen.Sendkeys("<Enter>")
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
strMembersID= Sess0.screen.GetString(21,16,10,0)

haha = Dialog(SearchPanel)
    Select Case haha
Case 1      
    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)        
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0108", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")

                   

Case 2     
    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select

        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0136", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")
    
Case 3     
    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sesss.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0170", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")

Case 4     
    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0155", 13,36      
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")

       

Case 5     

    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP

    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select

        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0165", 13,36       
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")  

Case 6     

    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select

        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0151", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")  

Case 7     

    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP

    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select

        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0144", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")                   

Case 7     

    Select Case SearchPanel.OptionGroup1 'SELECT CASE OPTION GROUP
    Case 0
    strXX= strAH
    Case 1
    strXX= strI2
    End Select
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.Screen.Sendkeys("<Clear>")
        Sess0.screen.PutString strIMXX, 1,1
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")   
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)       
        Sess0.screen.PutString strMemberIDr, 7,40
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.screen.PutString "0138", 13,36        
        Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
        Sess0.Screen.Sendkeys("<Enter>")              

Case 8   
Case 9
Case 10  
Case 11
Case 12   
Case 13
Case 14   
Case 15
Case 16   
Case 17
Case 18
Case 19 'USE SENDKEY ,<ENTER> TO MOVE TO NEXT SCREEN
Case 20 'CLOSE THE SearchPanel DIALOGBOX

End Select

End Sub 'ENDS SUB MAIN()

RE: How to keep a dialogbox open?

(OP)
hehe...found the answer in the forums, guess i wasnt looking hard enough!

RE: How to keep a dialogbox open?



Hi,

It is both customary and courteous to share your solution with other Tek-Tip members who will be browsing this forum.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

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