Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / CursorInNewField Event
Example
In This Topic
CursorInNewField Event
In This Topic
Occurs as soon as the cursor moves into a different field.
Syntax
private Sub IbmScreen_CursorInNewField ( 
   ByVal sender As Object, _
   ByVal row As Integer, _
   ByVal column As Integer _
) 

Parameters

sender
The source of the event.
row
Cursor row location.
column
Cursor column location.
Example

This example displays a message when the cursor enters a specific field.


To run this example, place the code in the ThisIbmScreen code window.

Private Sub IbmScreen_CursorInNewField(ByVal sender As Variant, ByVal row As Long, ByVal column As Long)
    
    Dim ScreenID1 As String
    Dim Rtn As ReturnCode
 
    'We want to display this message only on a specific screen.
    
    'Get the string at this screen position that uniquely identifies the screen
    'For this example, the text at row 1 and column 38 is 'Entry Panel'
    ScreenID = ThisIbmScreen.GetText(1, 38, 11)
    
    
    'Check to make sure the cursor is on the screen that has the field.
    If ScreenID = "ENTRY PANEL" Then
    
        'If the cursor enters the field on row 8 and between columns 8 and 29, display the message.
        If (row = 8 And column > 8 And column < 29) = True Then
        
            MsgBox "use - to separate dates. Ex 11-12-2021"
        
        End If
    
    End If
    
End Sub
See Also