Adding Columns To A Listview That Already Has Columns
Hi
I'm new to VB6 (I usually program in VB.NET but have been asked to make an enhancement to a VB6 application).
I have a listview which has columns defined within it in the designer. The code I am looking at then retrieves data from a db and puts it into the listview.
I've been asked to add another column in the middle of the listview e.g. there are 10 columns defined in the designer and this new column needs to go at position 6. However, the data that needs to go in the new column needs to come from a different query than the one that fills the other columns. I therefore thought that the best way to do it was fill up the original columns and then slot in the new column and fill it from another query. I've been searching around but can't find any example of how to do this.
Please can anyone help, or suggest a better way to do it? Thanks!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Resizing Columns In One Listview To Automatically Resize Corresponding Columns In Another.
I'm currently building the front end to a VB6 application. This app is largely based on entering data into a Listview. In order facilitate data entry, I need to create an editable row beneath the listview, comprising of text boxes(unless there is a better method) and an "add" button. The problem is that when a column in the Listview is moved or resized, the array of textboxes need to reflect this change of order/size, as each textbox needs to appear beneath its corresponding column. Also, if the listview contains a large number of columns, and therefore a horizontal scrollbar, the textboxes will need to scroll also... I would be very grateful for any help..! Thanks...
Adding A Column To A Listview That Already Has Columns
Hi
I'm new to VB6 (I usually program in VB.NET but have been asked to make an enhancement to a VB6 application).
I have a listview which has columns defined within it in the designer. The code I am looking at then retrieves data from a db and puts it into the listview.
I've been asked to add another column in the middle of the listview e.g. there are 10 columns defined in the designer and this new column needs to go at position 6. However, the data that needs to go in the new column needs to come from a different query than the one that fills the other columns. I therefore thought that the best way to do it was fill up the original columns and then slot in the new column and fill it from another query. I've been searching around but can't find any example of how to do this.
Please can anyone help, or suggest a better way to do it? Thanks!
Adding Items In Columns In A Listview
Hello
I am using a listview control that l want to add items to. The Listview contains 2 columns. One for name and the other for price. The name and price will be input by using a text box. When the user presses the command button the 2 will be added to the listview box.
I am not sure how to add 2 items into the two columns.
My code so far.
Code:
'Create the listview headings
ListView1.ColumnHeaders.Add , , "Name of Fruit"
ListView1.ColumnHeaders.Add , , "Price of Fruit"
ListView1.View = lvwReport
'Code adding to the listview box, but not sure how to add price
Set objfruit = ListView1.ListItems.Add(, , name.Text)
Many thanks in advance
Steve
MSHFlexrid Autosize Question/problem - Extra Columns After Sizing Columns To Autofit
I'm trying to use the MSHFlexGrid control, and it's almost a great thing, but not quite.
I wrote a VB app ( I'm a newbie, and my background is midrange program coding specifically RPG on an AS/400 so please keep that in mind. Event-driven programming and VB are new to me.) that will allow users to "drive" the application and select how they want to see the hierarchy. I let them choose from the pertinent fields and they are popped into a listbox control. The order in which they appear in the listbox control determines the hierarchy, and the underlying code writes the SHAPE, APPEND statements, etc...
So far, great... The problem I have is that since I have no way of knowing what hierarchy the user will select when they run the app, I have no way to know which columns will appear in the grid, or in what order, so there is no way to pre-size the column widths.
I found an autosize routine here posted by FlyGuy, so I put that code behind a button on the form called "AutoFit". When I run the code, it resizes the columns beautifully, but the column headings disappear from the sections over the "children" "grandchildren" "greatgrandchildren" , etc... columns.
Then if I do a collapse/expand, I find that the MSHFlexGrid control has a bunch of empty columns now between the original parent and child columns. The number of columns which appear are equal to the total number of child, grandchild, greatgrandchild, etc... columns fully expanded outward, so in the example shape statement below, I wind up with 16 empty columns on the control. Every subsequent autosize leaves the control with more blank columns. If I scroll far enough to the right, I find the children with their column headers.
The question I have is what is causing this ( the empty columns and the disappearing headings ) to happen, and can I do anything to stop it? I'm not sure it's usable for the end users if this continues to happen. Should I ( or can I ) dynamically set the column widths on the control at run time? Should I load the control by trying to iterate through all the recordsets and maybe do some sort of writing to the control directly? Is there a way to stop the control from showing the repeating columns in the children ( like maybe especially if I write directly to the control )? Can I ( if I write to the control ) format the columns so that numbers are right justified?
I'm using VB6 under Windows Xp Service Pack 2, and service pack 6 for Visual Studio 6 has been applied.
Here is how I was doing it: ( Warning: ugly code alert ):
Dim cnmx As ADODB.Connection
Dim rsMX As ADODB.Recordset
Set cnmx = New ADODB.Connection
Set rsMX = New ADODB.Recordset
With cnmx
.CommandTimeout = 0
.ConnectionTimeout = 0
.Provider = "MSDataShape"
.Open "dsn=<the dsn>;User ID=<the account>;Password=<the password>"
End With
rsMX.Open SQLShapeStatement, cnmx, adOpenStatic, adLockReadOnly, adCmdText
On Error Resume Next
If Err Then MsgBox Error
Set Form3.MSHFlexGrid1.DataSource = rsMX
Form3.MSHFlexGrid1.CollapseAll
rsMX.Close
cnmx.Close
Set rsMX = Nothing
Set cnmx = Nothing
Load Form3
Form3.Show
The value of the SQLShapestatement is:
SHAPE {SELECT USAGECOSTCENTER as Dept, cast(round(SUM(COST), 2) AS decimal(9, 2)) as DeptCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER ORDER BY DeptCst DESC} AS Level1
APPEND ((SHAPE {SELECT USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Equip_Num, cast(round(SUM(COST), 2) AS decimal(9, 2)) as Equip_NumCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) ORDER BY Equip_NumCst DESC} AS Level2
APPEND ((SHAPE {SELECT USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Equip_Num,ITEMNUM as Part_Num, cast(round(SUM(Quantity), 2) AS decimal(9, 2)) as Part_NumQty, cast(round(SUM(COST), 2) AS decimal(9, 2)) as Part_NumCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER, coalesce(left(
EQNUM,6),(right(USAGECOSTCENTER,4) + '99')),ITEMNUM ORDER BY Part_NumCst DESC} AS Level3
Append ({Select USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Line_Num, ITEMNUM as Part_Num, description as Prt_Desc, cast(round(QUANTITY, 2) AS decimal(9, 2)) as Qty, cast(round(COST, 2) AS decimal(9, 2)) as Cst, issuedate as Iss_Dte, Name as Emp_Nme From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' ORDER BY Cst DESC, Emp_Nme, Iss_Dte} as Level4
RELATE 'Dept' to 'Dept','Equip_Num' to 'Equip_Num','Part_Num' to 'Part_Num' )) RELATE 'Dept' to 'Dept','Equip_Num' to 'Equip_Num' ))
RELATE 'Dept' to 'Dept' )
Any suggestions welcome.
Sorting Array With 5 Columns By Any Column Or Columns
Hi all!
I have an array with 5 columns:
- city
- first name
- last name
- birth date
- children quantity
How can I sort this array by any column, for example by 4?
And how can I sort it by few columns, for example:
sort by 5 then sort by 1 then sort by 3?
Delete Emtpy Columns, Deleting All Columns
I've tried almost everything I can think of at this point.
I have a large report generated, imported to Excel.
The beginning of the code (not shown), breaks all merged cells, deletes blank rows, etc.
Now, I'm starting at the far right of the report and want to move column by column to the left deleting empty rows to bring the report together.
Excel 2003 SP2, VBA 6.3
Current code (not working correctly) reads:
Rows("1:1").Select
Selection.ClearContents
Range("A1").Select
ActiveCell.FormulaR1C1 = "END"
Term = "END"
Range("BL1").Select
While Not (ActiveCell = Term)
ActiveCell.EntireColumn.Select
delcol = False
If Value = "" Then
delcol = True
End If
If delcol = True Then
ActiveCell.EntireColumn.Delete
End If
ActiveCell.Offset(0, -1).Select
Wend
Starts by clearing all contents of row 1, places "END" in A1 so the loop knows when to close. Loop begins in BL1 and moves left until it encounters "END" (in A1) and stops.
Any suggestions or assistance would help maintain my sanity at this point!!!
Thanks in advance.
Dave
Columns(n).Autofit Error Past 257 Columns
When I run my code I get an "Application defined or object defined error" "run time error '1004'"
I thought I saw another thread with the same problem but couldnt find it.
Code:
Private Sub WriteExcelFile()
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
' Create the appropriate instances of Excel and create a new sheet
Set xlApp = New Excel.Application
Set xlWorkBook = xlApp.Workbooks.Add
Set xlWorkSheet = xlWorkBook.Worksheets.Add
' Make the application visible - just toggle the setting
xlApp.Visible = True
Dim n As Integer
For n = 1 To UBound(arrRecords)
'Size columns to data
xlWorkSheet.Columns(n).AutoFit ' <----- This is giving me the error
' Enter a value into cells
xlWorkSheet.Cells(n + 1, 1).Value = Format(arrRecords(n).string1, "#0")
xlWorkSheet.Cells(n + 1, 2).Value = arrRecords(n).string2
xlWorkSheet.Cells(n + 1, 3).Value = Format(arrRecords(n).string3, "#0")
xlWorkSheet.Cells(n + 1, 4).Value = arrRecords(n).string4
xlWorkSheet.Cells(n + 1, 5).Value = arrRecords(n).string5
If arrRecords(n).string6 = 0 Then
arrRecords(n).string6 = 0
Else
xlWorkSheet.Cells(n + 1, 6).Value = Format(arrRecords(n).string6, "$###,##0.00")
End If
If arrRecords(n).string7 = 0 Then
arrRecords(n).string7 = 0
Else
xlWorkSheet.Cells(n + 1, 7).Value = Format(arrRecords(n).string7, "$-###,##0.00")
End If
xlWorkSheet.Cells(n + 1, 8).Value = arrRecords(n).string8
xlWorkSheet.Cells(n + 1, 9).Value = arrRecords(n).string9
xlWorkSheet.Cells(n + 1, 10).Value = arrRecords(n).string10
xlWorkSheet.Cells(n + 1, 11).Value = arrRecords(n).string11
xlWorkSheet.Cells(n + 1, 12).Value = arrRecords(n).string12
xlWorkSheet.Cells(n + 1, 13).Value = arrRecords(n).string13
xlWorkSheet.Cells(n + 1, 14).Value = arrRecords(n).string14
xlWorkSheet.Cells(n + 1, 15).Value = arrRecords(n).string15
xlWorkSheet.Cells(n + 1, 16).Value = arrRecords(n).string16
Next
' Save the spreadsheet
xlWorkSheet.SaveAs "C: est.xls"
' Quit Excel
xlApp.Quit
' Clean up objects
Set xlApp = Nothing
Set xlWorkBook = Nothing
Set xlWorkSheet = Nothing
End Sub
Thanks
Edited by - epatterson78 on 5/25/2003 1:03:58 PM
Adding Columns In SQL
I am looking for a way to add a column into an existing SQL 2000 DB at a specific position.
IE
Insert field Temp3 between Fields Temp1 and Temp2.
I and using VB6 as an interface.
Need this type of functionallity for legecy reports that just display the data as it is read from the DB. I would like to keep from re-writing 100+ reports.
Thanks in advance,
Perry
Adding Columns With Yes/No DataType?
I've got the following code to add columns with a Yes/No format: But I get an error highlight on .Fields.Append .CreateField("fPack", "Yes/No") which states Run-time error 3421. Data type conversion error. I'm not sure what I need to type in place of "Yes/No" as my DataType.
Thanks for any help.
Code:
Private Sub Form_Load()
Dim db As Database
Set db = OpenDatabase("C:UPDATEOAorderentry_be.mdb", False, False)
Dim tdf As TableDef
Set tdf = db.TableDefs("tblOrders")
With tdf
.Fields.Append .CreateField("fPack", "Yes/No")
.Fields.Append .CreateField("fDel", "Yes/No")
.Fields.Append .CreateField("fAux", "Yes/No")
.Fields.Append .CreateField("fShut", "Yes/No")
End With
MsgBox "Updating done on database... yes Lexy, its that fast!"
Unload Me
End Sub
Adding Blank Columns
I have minimal experience with Visual Basic, but in order for a file import to work with another program, I need to add code to VB to add two empty columns after a data conversion has taken place. If anyone can help me with the code to create two blank columns, I would appreciate it. Thanks.
Adding To Listbox Columns
how do you add data to a listbox column(s). i have a string that I need to split into 4 columns. any help would be great.
Adding Columns At Runtime
I am trying to write VB code to add fields to some tables on an existing Access database. I tried simply executing an SQL ALTER TABLE statement:
Code:
ALTER TABLE Residents ADD Address2 VARCHAR(50)
This code does add the new column to the table, but with two problems: Allow Zero Length is turned off, and the new field goes to the very end of the database.
I need the new field to allow zero-length values, and I would like it to be placed between two existing fields. Are either of these possible with an ALTER TABLE statement, or is there another way to alter the database in code which would support these requests?
Datagrid Adding Columns
this is a really silly question, but i seriously dont know how to do it. How do i add a new column to a datagrid. It starts off with two, and all i want to do is add two more columns to it. why am i finding this so difficult! Isnt there just some option in the properties that lets you do this?
im using vb6.
Thank you.
Adding Of Columns At Runtime.
hi all , are there any sql statements or vbcodes for adding additional columns to a table in sql server at runtime?
thanks
Adding Up Database Columns
Hey anyone.
I wrote a program using an access database, now I'm not sure how to get the total of a field, eg. value for a record of a field lets say hours worked, which is differnt for each employee, now I want to get the total hours of all employees in the database.
If you can help Please
Thank You
Koos.
Adding Non Numbers Columns In Excel
When i run my COUNT(adding all numbers up) formula in Excel, let say for 50 rows and in 5 of these rows there are text instead of numbers and i get an error. Is there a way to make it work?
Adding Columns Headings Into A ComboBox ?
I have a combo box with 3 columns in it,
But I'm not able to use the columns heads property..
I want to see a header wich is always displayed on the first line when we scroll down...
I can see it , but it's always blank..
How can I put informations in it ???
MSHFlexgid Problem When Adding Columns
Hello Guys,
I have already posted it. But i didn't hear even a word. So i posted it again.Sorry Leaders.
Pls. Anyone there??????????????????????????????????????
I am using MSHFlexgrid to dislay records.
In this i set
cols=1
rows=2
Then Dynamically,i am adding row and col depending upon records.
when adding row it works.But col doesn't.
Here My code goes.
With ViewDelRecGrd
Do While Not DispDelrs.EOF
.Row = 1
For i = 0 To 2
.Col = i
If IsNull(DispDelrs.Fields(i)) Then
.Text = " "
Else
.Text = DispDelrs.Fields(i)
End If
.AddItem Col
Next
.AddItem Row
.Row = .Row + 1
DispDelrs.MoveNext
Loop
End With
I think I am right. Am I????
Can we populate col during run time?????????????????????
Pls
Let me know my fault.
Thanx for any advice.
sangeetha
List Boxes - Adding Columns
Hi guys - me again
Im just after a few moments of time from anyone who can help.
With the help from a dear board member, Ive managed to populate a list box with values of the names of different products. Ideally what I want to be able to do is show additional information about the product in the same line - possibly by adding columns.
The problem: I dont know how to add columns or set them up. Its probably something easy to do - but a maze for a newbie such as myself.
I would greatly appreciate help from anyone in "the know".
TIA
JG
Adding And Removing Columns In The Grid OCX VB6
I can use Add and Remove Item to add and remove rows in the Grid OCX but how do I add or remove columns. In an ideal world I would like to load a new Grid as a part of a control Array and dimension the number of columns and rows at run time as well as later add and remove columns?
Adding To Seperate Listbox Columns
I have a listbox with the columns property set to 2 for two columns.
I have two arrays that I want to add to the list box.
Array number 1 is InsDueNames() to go in column number 1
Array number 2 is InsdueDate() to go in column number 2
How do I add these to the different columns?
I have looked in MSDN, but I haven't found the answer.
My code so far is:
Code:
With lstMemb
.Visible = True
For ctr = 0 To UBound(InsDueNames)
. SET WHICH COLUMN HERE (Col Num 1)
.AddItem InsDueNames(ctr)
.SET WHICH COLUMN HERE (Col Num 2)
.AddItem InsDueDate(ctr)
Next
End With
Thanks.
URGENT!!!! Adding Columns To A Recordset
Hi,
Please treat this as urgent.
How do I add columns to an already populated recordset? If I create a blank recordset and then add columns to it from scratch, it works however, if I try to add columns to a recordset which is picked up from a database, it throws an error. Is it a limitation or a problem? Any workaround anyone can suggest? I would appreciate any pointer in this direction. Thanks in advance.
Regards,
Purnima
ListView Columns
How do i add columns to a ListView and also how do i insert information into a listview box? For my listview i require 3 columns: 'Artist', 'Track' and 'CD'.
I have tried adding columns using the properties dialog, but they don't appear when i run the form.
Any help is much appreciated!
James
Listview Columns
if I do lvwListView.listitems.additem ,, "test"
it adds an item in the first column of the listview
how do i add data in the second column of a listview
ListView Columns
I have four columns in a list view, each taking up 25% of the available space. When the form resizes, I am successfully resizing the ListView, but how do I resize each of the columns back to 25% of the new size.
I have tried ListView1.ColumnHeaders.Items(0).Width, but that results in a Out of Bounds Error. I have also tried with Items(1) with the same result.
Any idaes
Listview Columns
thought i would have a go using a listview in report mode.
i must be missing something and see what.
when i insert a column and give it a caption it will insert it but then i have 2 columns.
i wanted 3 columns altogether but it shows 4, always 1 more.
what am i missing ?
thanks
thingimijig.
ListView Columns
If I have 2 columns in a ListView (set to Report), how can I add data to them? I have tried for ages, and I cant figure it out.
Columns To A ListView
Is it possible to add Columns to a ListView manually or does it have to be done at runtime?
Two Columns In Listview
sorry, this may be a silly question but its very frustrating,
all i need is for my listview to display two columns of data, taken from a query currently i can achieve one column but i need to add another with "LastName" cheers, here is my code so far
Code:
Set cn = New ADODB.Connection 'we've declared it as a ADODB connection lets set it.
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= c:vdmcertymate VBdatadata.mdb" 'this is the connection string explained in the notes section.
cn.Open
Set rs = New ADODB.Recordset 'as we did with the connection
rs.Open "qryEmployees", cn, adOpenKeyset, adLockPessimistic, adCmdTable 'opening the recordset explained in the notes
'Code to populate the listView
While Not rs.EOF
lstvEmployees.ListItems.Add , , rs.Fields("FirstName").Value
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Me.MousePointer = 0 'Resets Mouse Pointer
oh. and how do i get the listview to add a verticle scrollbar?
Listview Columns
this is a quick question really can u parse a site out into a listview with columns for different info from the site?
its a bit tricky to explain and show you as i want to connect to a site in inet grab the source parse out some hardware information,how many on the site, and how many on order and the price into one listview nicely 'ordered with column headers..
i can connect and parse the hardware info into the listview fine but i was wondering on how to do the other parts but because u need an account on the site i cant show u it however here is some of the info from the source (the parts ive gotten out and im needing to parse out..
HTML Code:
>10/100MBPs NIC</a></td><td align="right">4.96 £</td><td align="right"><div class="g">4</div></td><td align="right"><div class="b">2<
theres say part of the info from the source ive gotten the 10/100 "part" fine but i need to get the "4.96, class="g">4< amount and class="b">2< amount (which change obviously...
is this possible to parse into a listview with columns to save me having to go to the site each time and then get those parts of the info which really defeats the purpose of the program? or do i need to use a different control other than listview?
any help or tips would be great
Listview With Different Columns?
In Listview I want to create 5 columns each having column header as "S.No", "From", "Subject", "Date", "Time"
I created Column headers in design time but they are not getting displayed? Also I want that S.No column to be having Checkboxes. How to do that? Thanks.
Listview Columns
I can only select the index column out of my data when in a listview. Code and input follows: Also I cannot input files other than the one I used to test with, of the same format?! (Not the one attached)
Option Explicit
Private Sub Form_Load()
Dim K As Integer
Dim itmX As ListItem
Dim clmX As ColumnHeader
K = 1
Set clmX = ListView1.ColumnHeaders.Add(, , "Column 1", ListView1.Width / 5)
ListView1.BorderStyle = ccFixedSingle
ListView1.View = lvwReport
ListView1.ListItems.Clear
Dim FF As Integer
Dim strLine As String
FF = FreeFile
Open "C:sheet.csv" For Input As #FF
Do While Not EOF(FF)
Line Input #FF, strLine
AddListView strLine
Loop
Close #FF
End Sub
Private Sub AddListView(S As String)
Dim Ar() As String
Dim i As Integer
Ar = Split(S, ",")
If UBound(Ar) > ListView1.ColumnHeaders.Count Then
For i = ListView1.ColumnHeaders.Count To UBound(Ar)
Dim clmX As ColumnHeader
Set clmX = ListView1.ColumnHeaders.Add(, , "Column " & i + 9, ListView1.Width / 5)
Next
End If
Dim lv As ListItem
Set lv = ListView1.ListItems.Add(, , Ar(0))
For i = 1 To UBound(Ar)
lv.ListSubItems.Add , , Ar(i)
Next
End Sub
Private Sub SortListView(ByRef List As ListView, ColHeadIndex As Integer)
Dim lcv As Long 'Loop Control Variable
With List
' Make sure the Sorted property is set to true
.Sorted = True
' Sort according to the colum that was clicked (off by one)
.SortKey = ColHeadIndex - 1
' Does the column already have an icon?
If .ColumnHeaders(ColHeadIndex).Icon = 0 Then
'No, So we will assume this column is not sorted
' Set to Ascending order
.SortOrder = lvwAscending
' Set the sort order to descending
.SortOrder = lvwDescending
Else
' Otherwise sort into ascending order
' Set to Ascending order
.SortOrder = lvwAscending
End If
' Refresh the display of the ListView Control
.Refresh
End With
End Sub
Listview Columns
when using a listview in report mode, do you always have to have a blank list at the end.
when i add columns through its properties there is always another blank one, and if i try and size it to fit the size i want it either still shows a bit of the blank one or i get rid of it and a scrollbar appears.
any ideas!
thanks.
thingimijig.
ListView Columns
Sups,
I got a listview with two columns on it.
I forgot how to add item to each column.
How can I do that?
tnx.
ListView And Columns
How can I set the column width to be that of the text? I tried:
VB Code:
lstOutput.ColumnHeaders(1).Width = TextWidth(strText)
But that didn't work...
Any ideas?
ListView Columns
I have 5 columns in the ListView, all were added via code at runtime. Now, for example, I want to remove column with index 2, problem is, the data from the last column disappears and all the data gets shifted so column with index 3 will now have what column with index 2 had before removing. Is there an easy way to remove column and all the data in it (like Access 2000 does) or do I have to go item by item moving subitems from each column to previous one making 2 last columns identical in data but not column header text, then it should work, because last column will be removed anyway. Here's when another problem comes up, if I add a new column, the data from last column will become visible again, so I really didn't remove column completely, just the column header and made data in the last column invisible. Maybe when I'm adding columns, I need to specify a key or index or what not to remove it completely? I just want to remove the whole column (header and data in it) completely, and shift all the columns to the left; and when I add a new column, I want it to be "blank", meaning no data in it. Of course, it all can be done via long code. I have to set each item's subitem of the new added column to "", etc. but there should be an easier way!
Thanks
Listview Columns
I have a listview with three columns. I want to load a table of names into the listview, putting last names A-F in #1, G-S in #2, and T-Z in #3.
I know how to loop through the table and load the names, but I don't know the listview code to separate the names into columns. Any ideas?
Listview With 3 Columns Help
Can anyone tell me how I can display a comma-separated textfile in a listviewbox with 3 columns when the form loads?
The textfile contains the following data:
script1, path1, time1
script2, path2, time2
script3, path3, time3
......
Listview Columns
okay,
how do I prevent the user from resizing the columns in the listview so that hidden columns (id numbers) can't be 'stretched out' and viewed?
David
Listview Columns
how the heck can i set up a list box so i can have a few columns?
lets say 1 displayign a url
anohter for the date
another for soemthign else?
thanx
?
Check For Duplicate Columns While Adding At Runtime
hi
I'm using vb6 and sql.
I'm was trying to add columns to a datagrid at runtime usind Ado. Actually I have been successful, except that I dont know how to check if a column being entered by the user already exists.Hence an error occurs if a col already exists.
Does any1 hav a soln????
Here is the code I'm using:
Private Sub Command1_Click()
Dim strSql4 As String
Dim res As String
res = InputBox("Enter Property Name", "Add Property")
strSql4 = "alter table rm_analysis" & _
" add " & res & " varchar (30)"
rsRM_ANALYSIS.Close
rsRM_ANALYSIS.Open strSql4, con, adOpenDynamic, adLockOptimistic
Adodc1.Recordset.Update
Adodc1.Recordset.Requery
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Adding Varying Nos Of Columns To Excel Reports From VB
Hi
I'm putting together a report specified in VB then produced in Excel. I'm really confused at the following...
I need to set specific columns based on specific information in other workbooks and worksheets (according to the user selection). The amount of columns will vary depending on the users choice so the additional columns will be added only when relevant. It can't be judged how many will need to be added as the user needs free reign over this (and it will vary). To top this off I need to put a 'Total' column at the end of each report adding the final totals for the featured columns.
Does anyone have any ideas how I go about this please? I've got my excel template ready and just can't figure out how to get started on this one. If anyone can help with this re the coding or links to other help sources that would be magic.
Thanks
Adding/ Setting Number Of Columns In A Datagrid
Hi group,
how can I add/ set the number of columns in a datagrid.
One reason I want to do this is that I need to add columns dynamicly.
An other reason is...I want to know it.
Regards,
Sander
Adding Items To Multiple Columns In Lisview
Could someone give me some quick same code of how to add items to multiple columns in Listview?
Say column 1 is the filename, and column 2 is the filesize.
would it be something like this
Listview.listitems., ,.........
Thanks
Adding Additional Rows And Columns In A DataGrid
Hi All,
Is it possible to add additional rows & columns in a DataGrid, even though
it is not being used, in order to fill the entire data?
For Example:
I've got two rows in my Datagrid with two columns containing Data. I would
like to add additional rows & columns to this datagrid to fill the entire
DataGrid with columns & rows.
I know that you can specify the number of columns & rows to display using a
MSFlexGrid, but is this possible with the DataGrid.
Thanks
Jolann van Dyk
|