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

Run code on specific screen only

Status
Not open for further replies.

Biznez

Technical User
Apr 9, 2015
106
0
0
CA
Hi, im running a code but i only want it to run on a specific screen in mainframe or a message box appears "Not correct screen". Need a code to run only in screen T900 please...thanks
 
Hi,

How about If [the text from the screen transaction area) = "T900" Then run the macro?
 
Hey Skip, do u have the code for this?
the positioning for the T900 screen is (1,2,5)
 
If Sess0.getstring(1, 2, 5) <> "T750" Then Exit Do
MsgBox"Mainframe is not set to the T750 screen. Please set to T750"
End If

Not sure where to put this code. before or after the Do
 
Why are you in a Do...Loop with this code?

Code:
Sub Main()    'this is the code you run for your screens
'code that runs on ALL screens
  If Sess0.getstring(1, 2, 4) <> "T750" Then 
' the code that runs on OTHER screens
  End If
end sub
 
got it thanks..works good now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top