Please help,trying to put selected items from array into list box 
Author Message
 Please help,trying to put selected items from array into list box

Im trying to open an array and put only selected entries into
a list box  , the code below opens my array and I tried the code at
the bottom to search the array but when It finds a match at the
start of the array it puts everything in behind it
Please email me at
        Paul Norrish

code to open file---------------------------------
Public Sub openfile(fileToopen As String)
Dim recordlen As Long
ReDim totalfood(0)
currentFile = ""
On Error GoTo noopenfile

recordlen = Len(totalfood(0))
Open fileToopen For Random As #1 Len = recordlen
numofrecordsinfile = LOF(1) / recordlen
Screen.MousePointer = 11
   For X = 1 To numofrecordsinfile
   ReDim Preserve totalfood(X - 1)
   Get #1, X, totalfood(X - 1)
   addrecord (X - 1)
   Next X

Public Sub addrecord(theindex As Integer)

For Z = LBound(totalfood) To UBound(totalfood)
If totalfood(Z).Calories = 300 Then
    fmainform!List1.AddItem totalfood(theindex).foodname
        fmainform!List1.ItemData(fmainform!List1.NewIndex) = theindex
do nothing
End If
Next Z

Sun, 24 Dec 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. please help,trying to put selected items from array into list box

2. help,Im trying to put selected items from array into listbox

3. Please help me put selected entries from array into listbox

4. Trying to Select a MDIList item from a combo box

5. List Box arrays Please help

6. Getting file info using a file list box and putting in an array

7. List Box - query selected item into table?

8. Select an item in list box with code

9. Quicker way to select all items in a list box

10. String value of selected item in list box

11. getting the selected item in a list box??

12. Removing multiple selected items from VB5 List Boxes


Powered by phpBB® Forum Software