Hi, i have the blocks of code below,
and I'm not sure what I do wrong, but
i want to be able to click on the
navigation button to move through
the record, but it also will highligh
on the grid for that same record navigated.
The code below seems to work but it will
highlight 2 rows at the same time -- the
row I click the first time and the row
I click next or previous.
let me know if I confuse you. thanks much for any input.
Private Sub GridHistory_Click()
Dim i As Integer
Dim x As Integer
x = gridHistory.Row
gridHistory.SelectionMode = flexSelectionByRow
With gridHistory
For i = 1 To x
txtCodeOrder.Text = gridHistory.TextMatrix(i, 1)
txtCodeID.Text = gridHistory.TextMatrix(i, 2)
txtCodeDesc.Text = gridHistory.TextMatrix(i, 3)
Next
End With
End Sub
Private Sub NavigateButtons(bVal As Boolean)
Dim i As Integer
For i = 0 To 3
cmdNavigate(i).Enabled = bVal
Next
End Sub
Private Sub cmdNavigate_Click(Index As Integer)
Dim II As Integer
Dim FF As Integer
FF = gridHistory.Row
gridHistory.HighLight = flexHighlightAlways
With gridHistory
Select Case Index
'First
Case 0
.Row = 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Previous
Case 1
.Row = .Row - 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Next
Case 2
.Row = .Row + 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Last
Case 3
.Row = .Rows - 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
End Select
End With
End Sub
and I'm not sure what I do wrong, but
i want to be able to click on the
navigation button to move through
the record, but it also will highligh
on the grid for that same record navigated.
The code below seems to work but it will
highlight 2 rows at the same time -- the
row I click the first time and the row
I click next or previous.
let me know if I confuse you. thanks much for any input.
Private Sub GridHistory_Click()
Dim i As Integer
Dim x As Integer
x = gridHistory.Row
gridHistory.SelectionMode = flexSelectionByRow
With gridHistory
For i = 1 To x
txtCodeOrder.Text = gridHistory.TextMatrix(i, 1)
txtCodeID.Text = gridHistory.TextMatrix(i, 2)
txtCodeDesc.Text = gridHistory.TextMatrix(i, 3)
Next
End With
End Sub
Private Sub NavigateButtons(bVal As Boolean)
Dim i As Integer
For i = 0 To 3
cmdNavigate(i).Enabled = bVal
Next
End Sub
Private Sub cmdNavigate_Click(Index As Integer)
Dim II As Integer
Dim FF As Integer
FF = gridHistory.Row
gridHistory.HighLight = flexHighlightAlways
With gridHistory
Select Case Index
'First
Case 0
.Row = 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Previous
Case 1
.Row = .Row - 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Next
Case 2
.Row = .Row + 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
'Last
Case 3
.Row = .Rows - 1
Call GridHistory_Click
For II = 0 To .Cols - 1
.RowSel = FF
.ColSel = II
Next
End Select
End With
End Sub