Input box set focus (1 Viewer)

tvman5683

Registered User.
Local time
Yesterday, 20:00
Joined
Oct 2, 2008
Messages
42
I have a module that opens an Attachmate Session, then prompt the user for input to continue the logon process. The problem is the Input box opens behind the Attachmate window. Is there code to bring the Input box forward?
Here's the part of the module that opens the Inputbox. when I step thru th code the box does come forward and seem to have focus. But when I run the module thru a button on a form it hides the Input box behind the open Session screen.

Thanks

Dim strUnitMsg As String
Dim strUnitInput As String
Dim distNumber


strUnitMsg = "Enter unit in this format: 8060"

strUnitInput = InputBox(strUnitMsg, "Unit Prompt")

distNumber = Trim(CStr(strUnitInput))


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)

' This section of code contains the recorded events
Sess0.Visible = True
Sess0.Screen.SendKeys ("abcdefg<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Clear>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("cesn<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("xxxxxx<Tab><Tab>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'g_szPassword = PasswordBox("Enter password")
Sess0.Screen.SendKeys ("1234567")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("ps30<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys (distNumber)
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Tab>8779")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
'Sess0.Visible = True
End Sub
 

gold007eye

Registered User.
Local time
Yesterday, 21:00
Joined
May 11, 2005
Messages
260
What if you made the input box a form. Then you could set the "Popup" / Modal properties to "Yes" which should make it be the top most form.

Other method you could try would be to hide the session screen form and then have the Input form open up and set focus to it.
 

tvman5683

Registered User.
Local time
Yesterday, 20:00
Joined
Oct 2, 2008
Messages
42
Thanks,
I'm going to try to minimize the session screen. I think that would be the easiest fix.
 

Users who are viewing this thread

Top Bottom