piattnd
asked on
Dynamic Listbox for HTA using VBscript
Experts,
I'm looking for a "professional appearance" solution for the following:
User input will calculate what usernames match the information provided by the user. Say the first letter input by the user is the letter N. All entries that start with the letter N will be populated into a listbox. I have the population of the listbox working.
The second part I need the VB to do is REMOVE items from the listbox that no longer match the input from the user. For example the first letter was N and the second letter is A. Anything that doesn't start with "Na" would be removed from the list and so on.
Any ideas?
I'm looking for a "professional appearance" solution for the following:
User input will calculate what usernames match the information provided by the user. Say the first letter input by the user is the letter N. All entries that start with the letter N will be populated into a listbox. I have the population of the listbox working.
The second part I need the VB to do is REMOVE items from the listbox that no longer match the input from the user. For example the first letter was N and the second letter is A. Anything that doesn't start with "Na" would be removed from the list and so on.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, I'll give this a shot.
Glad to help out. If you like the second method, there are ways to add additional columns to the list as well as small images.
ASKER
If you're still out there, I've dumped all user names from an AD query into a dictionary file. I then want to dump those into the listbox and perform the filtering as you had shown in the second example.
I'm having a problem with the command to add the items into the list. Can you still help? Below is what I had toyed around with, nothing is working.
I'm having a problem with the command to add the items into the list. Can you still help? Below is what I had toyed around with, nothing is working.
Sub BuildList
'Set objList = document.getElementByID( "lst_UserNames" )
'objList.ListItems.Clear
For Each strUser in dicUserNameList
'Set objListItem = objListItem.Add
'objListItem.Text = strUser
txt_filterUserNames.AddItem strUser
Next
End Sub
Try changing the sub to this...
Sub BuildList
Set objList = document.getElementByID( "lst_UserNames" )
objList.ListItems.Clear
for each User in dicUserNameList
Set objListItem = objList.ListItems.Add
objListItem.Text = User
next
End Sub
ASKER
I'll post up another question with my scenario, I think it's too in depth now to continue on this question
OK.
When you post the new question, can you add a comment with a link to the new URL please?
Thanks.
When you post the new question, can you add a comment with a link to the new URL please?
Thanks.
ASKER