List Box Problems

I am a bit of a begginer with this launguage so this question may sound really dumb.

I am loading a list box with data from the AS/400 which i am doing fine.  I have a menu option that i am creating to allow a user to change the way the data is viewed.  Bsically i am displaying Priority, Serial num etc  n the first view and in the second i want to display the view in Serial num, priority.  So when the 2nd view option is clicked i clear the list box, acess the data on the As/400 and add each record to the list box but this time adding serial number first + proprity etc.. all i get is a list load of "Falses".  When i debug the information i am adding to the list box seems fine, but when i do a quick watch for each record added, all that is displayed is a false.

I am no doubt doing somthing really dumb, so someone please HELP!!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CRICEAuthor Commented:
Edited text of question.
Pls post a code snippet...
CRICEAuthor Commented:
Here's the code i am using when i click for the 2nd view!

Private Sub MnuViewOrgRef_Click()

    'Screen.MousePointer = vbHourglass   'Set mouse icon graphic
    LstPMWPC10.Clear           'Clear list bix
    Call Load_Listbox("Org")

Function Load_Listbox(ByVal ViewLst As String) 'Load list box from As/400 file PMPCHDRP

    sMessage = " "
    sRequest = sMessage

    'Test for the router and get a conv. id...
    'The AS/400 program name is passed as an argument...
    Call APPCInitialize("PMWPC10CTL.PROJECT2")
    'Send and receive data....
    Call SendReceive(sRequest, sResponse)
    sData = Left$(sResponse, 1000)      '   Add retrieved record
    sMessage = Right$(sResponse, 24)    '   strip out message

    'Display department descripiton
    TxtDeptID.Text = Mid$(sData, 1, 30)
   'extract record while message back from 400 is okay..
    Do While Trim$(sMessage) = "0" Or _
            Trim$(sMessage) = "1"
         'If no more records being transfered then leave loop
         If Trim$(sMessage) = "1" Then
            Exit Do
         End If
         'Format received data for display on list box
         PriorityInt = Mid$(sData, 31, 5)   'Isolate priority
         PriorityStr = PriorityInt          'Convert priority value to a string
         RSet PriorityR = PriorityStr       'Right set the string value
         Status = Mid$(sData, 36, 1)
         SubStatus = Mid$(sData, 37, 3)     'Isolate sub status
         Serial = Mid$(sData, 40, 8)        'Isolate serial refernece number
         Description = Mid$(sData, 48, 50)  'Isolate description
         OrigRef = Mid$(sData, 97, 10)      'isolate originators reference
         'Add item to list box which is keyed by priority
         If ViewLst = "Pty" Then
         LstPMWPC10.AddItem PriorityR + Space$(3) + Status + Space$(3) + SubStatus + _
         Space$(3) + Serial + Space$(3) + Description + Space$(3) + OrigRef
         End If
         If ViewLst = "Org" Then
         LstPMWPC10.AddItem OrigRef + Space$(3) + Serial = Space$(3) + _
                            Status + Space$(3) + SubStatus + Space$(3) + Description
         End If
         Call SendReceive(sRequest, sResponse)  'go again
         sData = Left$(sResponse, 1000)
         sMessage = Right$(sResponse, 24)   'strip out message
End Function
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

CRICEAuthor Commented:
Adjusted points to 200

The problem is that you have included an '=' in this line of code:

  LstPMWPC10.AddItem OrigRef + Space$(3) + Serial = Space$(3) + _
  Status + Space$(3) + SubStatus + Space$(3) + Description

Change it to:

  LstPMWPC10.AddItem OrigRef + Space$(3) + Serial + Space$(3) + _
  Status + Space$(3) + SubStatus + Space$(3) + Description

Ture Magnusson
Karlstad, Sweden

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

Although this is not necessary, I recommend that you use '&' to concatenate strings, instead of '+', which should be used for mathematical addistions.

The line of code would look like this:

  LstPMWPC10.AddItem OrigRef & Space$(3) & Serial & Space$(3) & _
  Status & Space$(3) & SubStatus & Space$(3) & Description

CRICEAuthor Commented:
Ain't i the prize plonker!
Thanks, CRICE!

....and what is a prize plonker???

CRICEAuthor Commented:
Pize plonker = Idiot - which i am for not spotting such a stupid mistake.  Thanks for your advice on the & instead of + i shall use this as of now.
You may want to go through your source and check for rogue '=' signs matey!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.