creating label at runtime

04-20-2004, 03:25 PM
This site is really very useful and awesome.I could learn a lot from this site.

I got a problem.
I am trying to retrieve somedatas(flight info,airlines,timings) depending on the textbox input(FROM,TO,DATE).

I got many rows of datas.I could manage to put first row of data in 5-6 labels.
But i don't know how to create many labels at run time, so that all the rows can be displayed .
Is there any other way to display all the informations in any format?


Set MyRecSet = MyConn.Execute("SELECT * from airline_info where Origin= '" & from1 & " ' and Destination='" & to1 & " '")

Option1.Caption = MyRecSet!Airlines
Label4.Caption = MyRecSet!Flight_no
Label5.Caption = MyRecSet!Origin
Label6.Caption = MyRecSet!Destination
Label7.Caption = MyRecSet!Departing_time
Label8.Caption = MyRecSet!Arrival_time
Label9.Caption = MyRecSet!Cost


04-20-2004, 03:36 PM
A ListView control looks professional, can be sorted, text can be formatted some, and is easy to use once you get the hang of it. It appears when you add Microsoft Windows Common Controls to your toolbox.

04-20-2004, 03:46 PM
Could u tell me how can i add MS Windows common controls to tool box?
I didn't know anything about this.
Do i need to write any procedure to include the same?


04-20-2004, 04:05 PM
In your VB design view, simply press Ctrl+T. Hover over the new items added to your tool box until you find listview. Then press F1 & read your help files on using the listview. This was just one suggestion, I'm sure you will get others. Good luck.

P.S. If you have further questions on listview, should you want to go that route, I would not post them in this section of the forum, post in the General section.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum