VB6 Datagrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wernerh
    New Member
    • Jul 2007
    • 104

    VB6 Datagrid

    Hi could someone tell me where my code is incorrect? When I use the right arrow then the code works fine, when I try the down arrow it will not enter the figure and move 1 down.

    My code:

    If KeyCode = vbKeyRight Then
    KeyCode = vbKeyReturn And vbKeyTab
    End If
    ' -----------the above code works perfectly, the next set will not enter the data and move down---------

    If KeyCode = vbKeyDown Then
    KeyCode = vbKeyReturn And vbKeyDown
    End If

    Thanks
    Werner
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    In which event you are handling the code.

    Comment

    • Wernerh
      New Member
      • Jul 2007
      • 104

      #3
      [CODE=vb]Private Sub DataGrid1s_Keyd own(KeyCode As Integer, Shift As Integer)

      If KeyCode = vbKeyRight Then
      KeyCode = vbKeyReturn And vbKeyTab
      End If
      If KeyCode = vbKeyDown Then
      KeyCode = vbKeyReturn And vbKeyDown
      End If
      [/CODE]
      Hope that answers the question?
      Last edited by debasisdas; Mar 18 '08, 05:43 AM. Reason: added code=vb tags

      Comment

      • Wernerh
        New Member
        • Jul 2007
        • 104

        #4
        Does anyone have an idea here as to why the second part of the code won't work?

        Comment

        • Wernerh
          New Member
          • Jul 2007
          • 104

          #5
          Originally posted by Wernerh
          Does anyone have an idea here as to why the second part of the code won't work?
          Still no one that can help?

          Comment

          Working...