1,105,271 Community Members

listbox

Member Avatar
ng5
Light Poster
42 posts since Dec 2011
Reputation Points: 9 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have two different forms. one has a listbox and the other has a masked textbox. the masked textbox is used as a login and i would like the masked textbox to be checked against the listbox items to be able to "gain access" and login

Any ideas?

Member Avatar
Reverend Jim
Noli mentula
5,394 posts since Aug 2010
Reputation Points: 746 [?]
Q&As Helped to Solve: 643 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
1
 

You can try

If frmOther.ListBox1.Items.Contains(txtMasked.Text) Then
    'login OK
Else
    MsgBox("name not found")
End If

Assuming your other form is called frmOther, etc.

Member Avatar
M.Waqas Aslam
Practically a Posting Shark
837 posts since Aug 2011
Reputation Points: 67 [?]
Q&As Helped to Solve: 137 [?]
Skill Endorsements: 4 [?]
Featured
 
0
 

you can also use loop in order to check each items of the listbox. to gain access. but jim's solution is i think fast .

Regards

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: