Hi,
I am trying to detect words that are in a listbox by typing a word in a textbox then click if the word is in the box.
VB Code:
Private Sub Command1_Click() For b = 0 To frmSetup.Lstblock.ListCount If Text1.Text = frmSetup.Lstblock.List(b) Then MsgBox ("Word is not allowed") Else If Not Text1.Text = Text1.Text & frmSetup.Lstblock.List(b) Then Exit Sub End If End If Next b frmSetup.Show End Sub
This code works only when I type in the word that is the first word listed in the listbox. How can I make in so it checks for all the wors typed into the listbox?




Reply With Quote