how to display several rows of data on form

innovator2
innovator2 used Ask the Experts™
on
Please I need the help of experts here:

What I Need To Do:
I need to display several rows of data from a table on a form.
-Each row has 4 columns. I want each column to have no lines between them
-Each row should respond to a click event, displaying details of the row as a result.
-User should be able to edit/delete content of each row clicked

What I Have Done:
-I connected to the database using Jet 4.0 OLE db
-I displayed the rows nicely with a MSHFlexgrid

My Problem:
-I cannot make the HFlexGrid to respond to a click event (i.e each row did not respond to a click event)
-I could not edit data in the table while it is bound to MSHFlexGrid

I have tried using dataGrid (I did not know how to select each row with a single click; moreover, it does not look as I wanted). I tried DataList control (I could only display one column for each row). DBList didn't work either.

Please help!

Dave
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hello innovator2 !

You can use a ListView-Control (except 5.):

Set the type of the ListView to Report. Then you have

1. Multiple columns.
2. No Lines (ListView1.GridLines=False).
3. You have Events Like ListView1_Click and ListView1_ItemClick
4. You can access details of the a row using the Properties:
  a. ListView1.ListItems("blabla").Text 'For the first col
     ListView1.ListItems(1).Text 'For the first col
     OR
     ListView1.SubItems(1) 'For the 2nd col

5. You only can edit the Text of a Listitem, not the content of the other columns via user iterface.

But i would suggest following:

Take a Data-Control, bind it to a database and the data control to 4 Controls. If the user clicks in the ListView you could recordset.findfirst in the datacontrol.

You then could edit the data in the 4 controls.

v.k.

Author

Commented:
thanks.
I will try your suggestions

Dave

Author

Commented:
Hello, v.k.
I have just finished implementing your suggestions. I got a perfect result!
Thanks so very much.

Author

Commented:
This guy is obviously experienced.
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial