![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I'm wanting to have a phone # field on a user form, which users type in a contacts phone #. Next to it would be a listbox, that would display contacts whose phone # matches the phone number (or partial Phone #) that has been entered.
my contacts file contains around 3000 entries, and my first attempt to do this which cycled through each contact, took over a minute to run, which made the form useless. Basically the LookUpClientPhone field's onchange action triggered the re population of the listbox, by checking each contact in the contacts folder. Me.Listbox_Clients.Clear ' clear old values from list box If Len(LookUpClientPhone.Value) 4 Then 're populate if user has typed at least 5 digits of a phone number Debug.Print "updating lookup list" For X = 1 To ContactCount comparePhone = iCloudContacts.Items.Item(X).BusinessTelephoneNumb er comparePhone = Replace(comparePhone, "(", "") comparePhone = Replace(comparePhone, ")", "") comparePhone = Replace(comparePhone, "-", "") comparePhone = Replace(comparePhone, "", "") If InStr(comparePhone, LookUpClientPhone) 0 Then ' add this client to the list ' Debug.Print "Client " & iCloudContacts.Items.Item(X).FullName & " will be added to the list" ' End If ' Next X Paul |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Colors in Listbox | Guille | Outlook and VBA | 2 | July 1st 09 06:51 AM |
Listbox bound | Mike O[_2_] | Outlook - Using Forms | 6 | June 3rd 09 08:39 AM |
Outlook Script: How to separate datas in a listbox | bbnimda | Outlook - Using Forms | 1 | January 14th 08 05:39 PM |
listbox w/ multiselect (outlook forms) | David Chang | Outlook and VBA | 1 | January 8th 07 07:25 PM |
How Do I automate contat name on calendar | NewsSearch | Outlook - Calandaring | 3 | April 20th 06 01:41 PM |