colelinux
09-08-2003, 01:15 AM
I've asked a lot of question today.. lol..
however... i encounter another problem again! ARGH!
I tried to compare 2 strings using this:
Dim obj1 As String
Dim obj2 As String
obj1 = "*" & Text1.Text & "*"
obj2 = Text2.Text
If obj2 Like obj1 Then
MsgBox "Similar"
Else
MsgBox "Not Similar"
End If
obj1 is cole, and obj2 is MJ Cole.. and it works
When i move these codes to the actual program i'm working on.. which is a little bit different:
Dim obj1 As String
Dim obj2 As String
obj1 = "*" & txt_query.Text & "*"
obj2 = lst_artist.List(lst_artist.ListIndex)
If obj2 Like obj1 Then
MsgBox "Similar"
Else
MsgBox "Not Similar"
End If
obj1 is taken from a textbox, and obj2 is taken from the name of an item in a listbox.
I'm pretty sure obj1 is cole, and obj2 is MJ Cole... but the it shows out the message box "Not Similar"
Why? Why? Why in the world?
however... i encounter another problem again! ARGH!
I tried to compare 2 strings using this:
Dim obj1 As String
Dim obj2 As String
obj1 = "*" & Text1.Text & "*"
obj2 = Text2.Text
If obj2 Like obj1 Then
MsgBox "Similar"
Else
MsgBox "Not Similar"
End If
obj1 is cole, and obj2 is MJ Cole.. and it works
When i move these codes to the actual program i'm working on.. which is a little bit different:
Dim obj1 As String
Dim obj2 As String
obj1 = "*" & txt_query.Text & "*"
obj2 = lst_artist.List(lst_artist.ListIndex)
If obj2 Like obj1 Then
MsgBox "Similar"
Else
MsgBox "Not Similar"
End If
obj1 is taken from a textbox, and obj2 is taken from the name of an item in a listbox.
I'm pretty sure obj1 is cole, and obj2 is MJ Cole... but the it shows out the message box "Not Similar"
Why? Why? Why in the world?