I have a simple form which has a drop down combo and a MSHFlexGrid. The drop down combo contains a list of user id's, which will be use as a criteria.
The data in the MSHFlexGrid will be regenerated every time a new item is selected from the drop down combo.
The first time I select an item from the drop down combo, new data is populated in the MSHFlexGrid and I can select any row (selection mode is by row) from the MSHFlexGrid. However, the next time that I select an item from the combo, new data is also populated in the grid but I cannot select any row from the grid, it's default to the first row. The grid now is unselectable.
Please tell me what is wrong. Following is the code that I used to populate the MSHFlexGrid. Note: the recordset is small.
DIM rec ADODB.recordset
Set rec = CreateMyRecSet("SELECT * FROM User WHERE UserId = " & cboUser.text)
Set myMSHFlex.datasource = rec
set rec = nothing
Function CreateMyRecSet(strSQL as string) AS ADODB.Recordset
.....This function returns a recordset without any problem