PDA

Click to See Complete Forum and Search --> : Selecting a record from a Flex Grid in VB6


FLL
Aug 25th, 2000, 05:59 PM
OK, I tried Dr. Evil's code on the link that was provided, but I was not able to get it to work. Let me try this again:

I have a form which searches a DB. If multiple records are pulled from the query, it loads another form with an MS Flex Grid. From there, I want the user to be able to double click one of the records and have it load some controls on the other form.

1) I don't know that there is a double click event on the MS Flex Grid (a double click event for a single row, not the entire grid)

2) Is there some creative code to emulate a double click event, allowing the user to select a specific record from the Flex Grid?

3) Is there a better control to use than the Flex Grid?

Thanks a lot.

FLL

DrewDog_21
Aug 25th, 2000, 06:33 PM
I could be wrong here, so someone correct me if I am.

FLL, to the best of my knowledge, the MSFlexGrid is read-
only, and thus any recordset that it is connected to does
not change records when the grid is clicked. I haven't
used it a whole lot, though, so I could be wrong on that
part.

One other control that you could use is the DataBound Grid
Control. You will have to connect it to an ADO recordset.
When you click on any row, the recordset moves to that
particular row. Then in the DBGrid's DoubleClick event,
you could add your code to do what you need to do, based on
the current record of the recordset. Don't forget to set
the DBGrid's AllowAddNew, AllowDelete, and AllowUpdate
properties to false so that the user can't change the data.

PJB
Aug 25th, 2000, 09:09 PM
MSFlexGrid is read only, but what i found out today is to install the Data Bound Grid i had to jump thru hoops, If you've never had a previous version of VB - VB6 does not install the liscensing info for Data Bound Grid
or i installed wrong, either or it really pissed me off...

MSHFlexGrid is a litle more flexible though