Dbl click event (MSFlexGrid) move record to new form.

10-21-2004, 07:51 AM

I am developing a piece of software for a local college sports department. I am having difficulty with a function tough.

I have an MSflexgrid which is populated using a DAO data control.
it populates with the data from one of the tables in the database.

i am hoping to get it so that i can double click a record in the msflexgrid and on this event, it opens a new form and inputs the data into the necessary fields.

These fields are labels. (title, forename, surname, etc.)

any ideas?

my code is not worth displaying here.


10-21-2004, 11:34 AM
Well, you can use (preferably) a custom Property on the receiving form that will accept the unique ID of the record on the FlexGrid. Then, on a FlexGrid double-click, set the unique ID as the form's custom property, show the form, and query the DB for the record's data WHERE the ID equals the value of the form property. Alternatively, but more coding, you can create a property for each column of the flexgird and pass all the info via custom form properties. It would save a DB call, but would be much more code maintenance.

If you really want to do it the Object Oriented way, create a class to represent the record, and pass an instance of the class to the form that will have a custom form property of type <your class>. This would be best if you have many uses of this record type throughout your program.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum