|
-
Jan 26th, 2000, 05:08 AM
#1
Thread Starter
Addicted Member
I have a listbox that retrieves data in a comma delimited format. How can display the data in the listbox in a column format. Currently, all data is displayed in one column. I want to partition the listbox in a grid like fashion.
Thanks!
-
Jan 26th, 2000, 06:34 AM
#2
-
Jan 26th, 2000, 06:38 AM
#3
Why not use a grid?
------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.
-
Jan 26th, 2000, 07:09 AM
#4
Hyperactive Member
Hi, Hutty.
You can do it only using Tab, but it won't look nice. It's better to use Grid control or listview. But you can try.
rs.MoveFirst
Do Until rs.EOF
List1.AddItem rs.Fields(0) & vbTab & rs.Fields(1) & vbTab & rs.Fields(2)
rs.MoveNext
Loop
Larisa
-
Jan 26th, 2000, 10:59 PM
#5
Thread Starter
Addicted Member
Thanks guys for your responses. I didn't mentioned before that the data is not being retrieved from your conventional access database. I'm accessing one of the .dll files from our financial software using "Application Program Interface (API)".
It looks like the Grid would be my best option, but nothing happens when insert where list1 is located in code. I believe I'm not using the DBGRID function correctly. Any code on how to use the dbgrid instead of listbox in code.
Thanks!
-
Jan 27th, 2000, 02:09 AM
#6
Addicted Member
The listbox idea is very workable. By using report view with subitems you can create columns of any width.
dim clmx as columnheader
dim itmx as listitem
set clmx = listboxname.columnheaders.Add(index, key, TEXT, WIDTH, alignment, icon)
' add a column header for each column
set itmx = listboxname.listitems.add(index, key, TEXT, icon, smallIcon)
itmx.subitems(1) = nextcolumn
' add a subitem for each additional column
Good luck.
-
Jan 27th, 2000, 02:19 AM
#7
Thread Starter
Addicted Member
HDR,
This is what the return string looks like in the list box.
LFDIV,FY_PREMIUM.STAT_INP,833942,1600819,2479545,653
LFDIV,REN_PREMIUM.STAT_INP,2225176,4551447,6792469,5131
LFDIV,SP_PREMIUM.STAT_INP,1765550,3273375,4654127,0
LFDIV,INW_PREM.STAT_INP,98397,186944,397835,149
LFDIV,OUTW_PREM.STAT_INP,472102,667209,863370,3088
LFDIV,RET_PREM_G.GAAP_ADJ_INP,-1615228,-3264710,-4812230,0
LFDIV,RET_PREM_G.GAAP_TL_INP,29435,148182,-68583,0
LFDIV,NIINCOME.STAT_INP,999352,2038943,2839070,585
LFDIV,NII_INC_ASSO.STAT_INP,1382,3771,7712,0
LFDIV,NII_FIN_SERV.STAT_INP,2675,4964,6493,0
LFDIV,NII_DIVELIM_DOM.STAT_INP,-40,-81,-126,0
LFDIV,NII_DIVELIM_FOR.STAT_INP,-1961,-3921,-6110,0
Is the code you provided workable as it relates to the above/
Thanks!
-
Jan 27th, 2000, 12:49 PM
#8
Frenzied Member
If you want to store stuff in a grid that isn't in a database you can a) spend hours of pain and anguish trying to use DBGRID or b) buy Apex TrueDBGrid from www.ApexSC.com and use the XArray object which you can populate with any data you like and then bind it to a grid as if it was a database.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Jan 27th, 2000, 03:24 PM
#9
New Member
If you have a lot of data, you might want to investagate importing it into an Access table and then exporting the table to VB.
A while ago I transferred all the data from a 4th dimension database to an Access database, and the raw data looked exactly like yours.
If I remember correctly, Access had no trouble separating the comma delimited data into different fields.
Of course, this depends on the project. If you're talking about a one time deal, then the Access idea might work. If it's something your program would do all the time, then it's different.
WillP
-
Jan 28th, 2000, 01:52 AM
#10
Addicted Member
Yes, it is very workable. Do the 'clmx =' thing six times to set you columns and headers (once for each column.) Do the 'set itmx =' thing once per row. You can use an index for the row, or you can build a key (must have at least 1 alpha character.) Your data for the first column goes here. Then for the other five columns, use the 'itmx.subitems(column) =' thing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|