Click to See Complete Forum and Search --> : Control Break processing
bdcanetti
April 2nd, 2001, 02:52 PM
I need to know how to enter a new headline every time the first field in a ListBox changes.
My output looks like this:
1 56743 $1200
1 64564 $5400
2 56456 $7853
3 98798 $5645
3 54564 $5456
4 98798 $5645
ETC..
SO how do I enter a new headline any time the 1,2,3 or 4 change.
This is being displayed in A LISTBOX.
Thanks,
Ben
Cimperiali
April 3rd, 2001, 01:47 AM
What do you mean with headline? Do you need to add a new line in your listbox and have it in first position?
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
bdcanetti
April 3rd, 2001, 10:34 AM
Sorry, I mean I want to Add a new Header like:
JOB CODE EMP NUMBER SALARY etc..
Any time the first field which is job code changes.
Cimperiali
April 4th, 2001, 02:21 AM
If matter is to put a line in first position of listbox, you can try this code:
Dim i As Integer
For i = 0 To 3
List1.AddItem i 'just to put some data
Next i
'now insert a new first line:
List1.AddItem "job,code,match", 0 'where 0 is the index position, which means: as first row.
If you want this to work each time something change, you should put the
list1.additem "job, etc",0
instruction in the event where you make the list1 values to change.
To look for modified first column values (remember you're testing a string) you should store values in an array (just first column value) and test if new values differs from old ones:
for i= 1 to list1.listcount-1
if left(list1.list(i),1)<> myoldvalue(i) then 'suppose your first column is only 1 char len
'something changed
'redraw line you need,
'refresh your "myoldvalue" array
end if
next i
This is only an example, you should work on this to make it suite you.
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
bdcanetti
April 4th, 2001, 07:27 AM
Thank You I believe this will work!!!!!
Cimperiali
April 4th, 2001, 07:32 AM
Good. If it is not enough, post a new question, and name it:
"listbox question"
as "control break process" seems a little confusing...
Best regards,
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.