If KeyAscii = 13 Then
        Text48.SetFocus
End If

解决方案 »

  1.   

    If KeyAscii = 13 Then
            Text48.SetFocus
    End If
      

  2.   

    If KeyAscii = 13 Then
            Text48.SetFocus
    End If运行到KEYASCII时还是提示变量未定义!请大家帮帮忙!
      

  3.   

    Private Sub Text47_KeyPress(Index As Integer, KeyAscii As Integer)
       If KeyAscii = vbKeyReturn Then
          Text48.SetFocus
        End If
    End Sub
      

  4.   

    Private Sub Text47_Change()
        If KeyCode = vbKeyReturn Then
            Text48.SetFocus
        End If
    End Sub
    -----------------------------------------------
    在Change中是不能访问KeyCode的,
    只能在
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)End Sub
    这里访问KeyCode这个变量
      

  5.   

    你可能是设计时双击Text47打开吧,一般打开的是Text47_Change事件处理过程,根据你想实现的功能看,应该用Text47_KeyPress才对,注意到没有Text47_Change过程是没有参数的,Text47_KeyDown带有参数KeyAsciiPrivate Sub Text47_KeyPress(KeyAscii As Integer)
      If KeyAscii = vbKeyReturn Then
        Text48.SetFocus
      End If
    End Sub