Computing.Net > Forums > Programming > VB6 & Access 2000

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6 & Access 2000

Reply to Message Icon

Name: Mark Long
Date: July 30, 2004 at 04:38:36 Pacific
OS: Win98
CPU/Ram: 300/512
Comment:

I am trying to get the data contained in a database to appear in a list box on a form in VB, I have no problem getting the data to appear eg.

ProductNo
Manufacturer
Product Line
etc

one after the other vertically but I want the data to appear horizontally eg.

Product No Manufacturer Product Line etc.

I am using data control to retrieve the data to the form.

How do I get the data to display as I would like? Also I would like for there to be vertical lines separating each field item to give the effect columns in the listbox display.

Thanking you

Regards


M



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: July 30, 2004 at 07:40:10 Pacific
Reply:

You need you use one of the Grid controls. Either the MSFelx Grid or the DataGrid.

These allow you to display the Data in a similar fashion to a spreadsheet.

Do do what you want with a List Box is possible but cumbersome. The Grid controls are the right tool for the job.

Stuart


0

Response Number 2
Name: Mark Long
Date: August 1, 2004 at 15:31:21 Pacific
Reply:

Thanks Stuart,

For the prototype I have to build, prior to the actual project which I intend to use Access forms MSFlexGrid will do brilliantly providing I can specify what is to be displayed, the test I ran displayed all fields & I could not find how to alter this. Also is there a way to change the size of the cells, my data is not fully displayed?

I liked the look of the data grid as it looked more flexible but I could not get data to display, I set the data control and data source etc but nothing, I also had a go with list grid but this only displayed the first field no matter what field I selected.

I have looked in all my books but no mention of the above functions and before I venture into the depths of VB Help have you a basic english tutorial you could give if only on how to make the flex grid flex? as I have a feeling the data grids are going to be involved.

Thanks again

Regards

M


0

Response Number 3
Name: StuartS
Date: August 1, 2004 at 15:59:54 Pacific
Reply:

>> before I venture into the depths of VB Help <<

Thats the first thing to do, it full of useful information. The VB Help gives you all the information you need and some good examples.

Chenge the width of coeels with the CollWidth Property. There are two ways of deciding which fields are displyed. Either only axtract the rquired fileds with the SQL statement, or itereate through the recordset and fill the Grid under your control.

The list control will only ever display one field - thats all its meant to do without a lot of manipulation.

Stuart


0

Response Number 4
Name: Mark Long
Date: August 1, 2004 at 16:22:04 Pacific
Reply:

Plain lazyness, my main PC's processor fan broke today and I can't locate the CD ROM drive for my laptop etc etc. Thanks for the reply I have managed to suss DataGrid enough to do the job and looking at how relatively simple it was I may now build a front end using VB6.

Regards

M


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 & Access 2000

VB6 and Access 2000 www.computing.net/answers/programming/vb6-and-access-2000/10084.html

VB6 & Access 2000 Record Problem www.computing.net/answers/programming/vb6-amp-access-2000-record-problem/9154.html

VB 6 & Access 2000 www.computing.net/answers/programming/vb-6-amp-access-2000/10789.html