string help

spartan086

Member
Joined
Mar 23, 2011
Messages
9
Programming Experience
Beginner
so my program takes what the user enters into a textbox and searches through the data i have stored and if it matchs one of the peices of data it displays the apropriate data to the user.
This all worked fine till i changed the textboxes to be added dynamicly to the form when it is load and i put all textboxes in a collection. So now when the text is sent to the search sub it sends the data over but always returns that it didnt find a match.
But if i go into the search sub and just tell it what to search for automaticly it finds it no problem.
What am i missing here?
 
some code would be useful..But you have to go through each line and check the values that are passed to your routine, where they are coming from, and what the expected result should be. Storing a collection of textboxes is not necessary because they should exist in your forms .Controls collection and if you need to reference them you should be able to from there if you do not add dynamic controls to that collection that could be an issue.
 
ok so the program is for when customers come into the store they get a laptop with a scan gun they then go around the show room scanning items. everytime they scan in my app the bar code number shows up in the first text box, the scan gun automaticly hits tab which i have to triger the search.
search(C.Item(1).text)
I have made a collection which i called c. Every text box is made and put into this collection.

If (items(x).Equals(searched)) Then

when the program loads all the items are loaded into the items array. Searched is c.item(1).text.
When i throw a msgbox in to tell me what searched is it says
056348021405 (if thats the upc code i enter)
but the search returns with no matchs.
But if i change the code to
If (items(x).Equals("056348021405")) Then
the code will find it.
(sorry about the text change it happened when i copyed from vb)​
 
ha ok i got it, instead of
search(C.Item(1).text)
i made a temp string that i called searchTemp and put C(1).text into it
searchTemp = C(1).text
then i did the search with the searchTemp
search(searchTemp)
 
Back
Top