Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Setfocus

$
0
0

I have 20 Textboxes lined up down a screen that operators enter data into one and then have to click on to the next so on and so on. How can I make it where they can down arrow or enter to get to the next one below.

 

The manual says this...

2.0.1.Different Containers Support Different Sets of Extender Properties

Certain extender properties that are made available to objects by the VB container are not supported in VBA in PI ProcessBook. For example, setfocus and gotfocus work with userforms (i.e. dialog boxes) in VB but not in PI ProcessBook VBA. Also, PI ProcessBook does not support the visible property for a commandbutton.  (See the online help for VBA in PI ProcessBook at \\program files\pipc\help\pipbvb.chm for more information. This is also available from inside the VBA editor in ProcessBook.

 

my code is 

 

Public Sub WriteTagValue3RSTM() '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 1

    Dim szTag As String
    Dim szSrv As String
        
    szTag = "33:#3RSTM.ME"
    szSrv = "cpcropi"
    Application.ActiveDisplay.SelectedSymbols.RemoveAll
    Application.ActiveDisplay.Revert
    
    If (box3RSTM.Text >= -100) And (box3RSTM.Text <= 100) Then 'Create upper and lower
            SetPITagValue szSrv, szTag, box3RSTM.Text, Now
            box3RSTM.ForeColor = RGB(0, 0, 0) 'black
            box3RSTM.Text = ""
            box2 = MsgBox("   Test Entered", [vbExclamation], " ")
    Else
            box2 = MsgBox("Out of Range!", [vbExclamation], " ")
            box3RSTM.ForeColor = RGB(0, 0, 0) 'black
            box3RSTM.Text = ""
    End If
  
    
End Sub
 
Public Sub WriteTagValue3STSD() '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2
    Dim szTag As String
    Dim szSrv As String
        
    szTag = "33:#3STSD.ME"
    szSrv = "cpcropi"
    Application.ActiveDisplay.SelectedSymbols.RemoveAll
    Application.ActiveDisplay.Revert
    
    If (box3STSD.Text >= 0) And (box3STSD.Text <= 100) Then 'Create upper and lower
            SetPITagValue szSrv, szTag, box3STSD.Text, Now
            box3STSD.ForeColor = RGB(0, 0, 0) 'black
            box3STSD.Text = ""
            box2 = MsgBox("   Test Entered", [vbExclamation], " ")
    Else
            box2 = MsgBox("Out of Range!", [vbExclamation], " ")
            box3STSD.ForeColor = RGB(0, 0, 0) 'black
            box3STSD.Text = ""
    End If
  
    
End Sub
 
and I have tried
 
Private Sub box3RSTM_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Me.box3STSD.SetFocus
End Sub
 
and 
 
 
Private Sub Display_Open()
Zoom = "FitAll"
box3STSD.SetFocus
End Sub
Capturemm.JPG
Is this even possible (Attached is my screenshot of part of my screen) my operators complain because they have to click into every box! 
 
 

Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>