I have a flexgrid where the first column holds numbers.
The code below shows tooltiptext based on these numbers when you move the mouse over them.
With the following code, how can I stop getting integer overflow errors when the mouse moves over the flexgrid where there is no valid line ? What I mean is the maximum number of rows which can be displayed at once is 15, but if only the first 2 or 3 are populated, this leaves a 'grey area' and the code below can't handle that, and if the mouse moves in this 'grey area' I get integer overflow errors at the line marked with an arrow.
Can anyone help me out ? I need to sort this quick, so any input would be very much appreciated.
Thanks in advance.
VB Code:
Private Sub flxDetails_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Static SelectedRow As Long Dim rowNum As Long Dim colNum As Long Dim z As Integer Dim BrnName As String * 30 If ReadyToProceed Then With flxDetails rowNum = y \ .RowHeight(1) + .TopRow + 1 colNum = x \ .ColWidth(1) + .LeftCol + 1 If rowNum <> SelectedRow And colNum = 1 Then SelectedRow = rowNum For z = 0 To 999 --> If .TextMatrix(rowNum - 2, 0) = tmpBRN(z) Then BrnName = tmpBrnName(z) x = 999 End If Next z .ToolTipText = Trim(BrnName) If .TextMatrix(rowNum - 2, 0) = "050" Then .ToolTipText = "Nantgarw Warehouse" Exit Sub End If End If End With End If End Sub


Reply With Quote