How to move the cursor to the next DBGrid column after selected an item from DBList box? 
Author Message
 How to move the cursor to the next DBGrid column after selected an item from DBList box?

Hello:
        I have a question about moving the cursor to the next column after
copying the content of a DBList box to the current cell.  

        When the cursor move to columns(5) in DBGrid1, a DBList box,
DBlstOperatorNo will appear at the column.  When I move the key <- or -> the
content of the DBList box will copy to the current cell, and the DBlist box
will disappear.
        The problem is: When press the key <- everything is fine and the
cursor move to columns(4).  However, when press the key -> the cursor move
somewhere outside the DBGrid, not the columns(7). (Code is shown below)

        Can anyone please tell me how to solve the problem? Any example?

Thanks in advance!

Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    If DBGrid1.Col = 5 Then
        Dim zCol As Column
        Set zCol = DBGrid1.Columns(DBGrid1.Col)
        With DBlstOperatorNo
            .Width = zCol.Width
            .Left = DBGrid1.Left + zCol.Left
            .Top = DBGrid1.Top + DBGrid1.RowTop(DBGrid1.Row)
            .Visible = True
            .SetFocus
        End With
    End If
End Sub

Private Sub DBlstOperatorNo_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyLeft, vbKeyRight
            DBGrid1.Text = DBlstOperatorNo.Text
            DBlstOperatorNo.Visible = False
    End Select
End Sub



Tue, 20 Feb 2001 03:00:00 GMT  
 How to move the cursor to the next DBGrid column after selected an item from DBList box?
Hello:
        I have a question about moving the cursor to the next column after
copying the content of a DBList box to the current cell.  

        When the cursor move to columns(5) in DBGrid1, a DBList box,
DBlstOperatorNo will appear at the column.  When I move the key <- or -> the
content of the DBList box will copy to the current cell, and the DBlist box
will disappear.
        The problem is: When press the key <- everything is fine and the
cursor move to columns(4).  However, when press the key -> the cursor move
somewhere outside the DBGrid, not the columns(7). (Code is shown below)

        Can anyone please tell me how to solve the problem? Any example?

Thanks in advance!

Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    If DBGrid1.Col = 5 Then
        Dim zCol As Column
        Set zCol = DBGrid1.Columns(DBGrid1.Col)
        With DBlstOperatorNo
            .Width = zCol.Width
            .Left = DBGrid1.Left + zCol.Left
            .Top = DBGrid1.Top + DBGrid1.RowTop(DBGrid1.Row)
            .Visible = True
            .SetFocus
        End With
    End If
End Sub

Private Sub DBlstOperatorNo_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyLeft, vbKeyRight
            DBGrid1.Text = DBlstOperatorNo.Text
            DBlstOperatorNo.Visible = False
    End Select
End Sub



Tue, 20 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to move the cursor to the next DBGrid column after selected an item from DBList box?

2. How to move the cursor to the next DBGrid column after selected an item from DBList box?

3. Causing the cursor moves to next tab stop when a field has reached its maximum

4. Arrow key to move cursor to next textbox???

5. Arrow keys to move cursor to next textbox.

6. How do I move cursor to next textbox after hitting enter

7. Move One Column to the Next

8. Move to the next column.

9. Moving to next column in a Database

10. Moving to next column in a Database

11. Moving to next column in a Database

12. Show data when next item is selected in listview object

 

 
Powered by phpBB® Forum Software