I have a msflexgrid on a form which I populate with a SP......What
I want is to conduct a search and highlight the appropriate row.....my problem is that the RS is highlighted but the flexgrid
does not scroll down and make the selected RS visible...
Hope you can understand!!
VB Code:
Private Sub cmdfind_Click()
Dim LngColumns As Long
Dim LngRows As Long
On Error GoTo cmdfind_Click_Error
For LngColumns = 0 To MSFlexReview.Cols - 1
For LngRows = 1 To MSFlexReview.Rows - 1
If InStr(MSFlexReview.TextMatrix(LngRows, LngColumns), txtPalletID) Then
Call HiglightMSflex(LngRows)
End If
Next LngRows
Next LngColumns
Exit Sub
cmdfind_Click_Error:
Call ModError_log 'All error descriptions written to a error log
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdfind_Click of Form frmReview"
End Sub
Thanks for your help
Has anyone any suggetions on how I could accomplish this?
I receive an 'error 0'.....I know error 0 indicates that it is not
a severe error but the code does not work.....and the debug
highlights the below line as being the error.....
Originally posted by holly I receive an 'error 0'.....I know error 0 indicates that it is not
a severe error but the code does not work.....and the debug
highlights the below line as being the error.....
MSFlexReview.TopRow = CInt(txtPalletID)
Thanks
Error 0 means that there is no error. That "error" is usually the result of code falling through to the error routine, but since you seem to have an Exit Sub before the error routine I don't understand why it's happening. In any case to show the bottom of the flexgrid do this.
This has nothing to do with the TopRow problem but the Error 0 problem.
The call to the ModError_log procedure is clearing the Err object. When the code resumes in cmdfind_Click_Error for the msgbox, err.number = 0, err.description = "".